Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * RHQ Management Platform
  * Copyright (C) 2005-2008 Red Hat, Inc.
  * All rights reserved.
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation version 2 of the License.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
package org.rhq.helpers.rtfilter.filter;
Extend the ServletResponse to be able to retrieve the status code. I would love to correctly use

Heiko W. Rupp
but this needs to run with jre1.4 as well.
public class RtFilterResponseWrapper extends HttpServletResponseWrapper {
Http status code (200=ok, 404=not found, 500=error etc. Default is 200, as the code only gets set when there is something not ok.
    private int statusCode = 200;
    public RtFilterResponseWrapper(HttpServletResponse response) {
    public RtFilterResponseWrapper(ServletResponse response) {
    public void setStatus(int code) {
         = code;
    public void setStatus(int codeString msg) {
         = code;
    public int getStatus() {
        return ;
    public void sendError(int scthrows IOException {
         = sc;
    public void sendError(int scString msgthrows IOException {
         = sc;
New to GrepCode? Check out our FAQ X