Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2003-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 //
 // This source code implements specifications defined by the Java
 // Community Process. In order to remain compliant with the specification
 // DO NOT add / change / or delete method signatures!
 //
 
 package javax.servlet;
 
Provides a convenient implementation of the ServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped response object.

Version:
$Rev: 46019 $ $Date: 2004-09-14 04:56:06 -0500 (Tue, 14 Sep 2004) $
Since:
Servlet 2.3
See also:
ServletResponse
 
 public class ServletResponseWrapper implements ServletResponse {
     private ServletResponse response;

    
Creates a ServletResponse adaptor wrapping the given response object.

Throws:
java.lang.IllegalArgumentException if the response is null.
 
     public ServletResponseWrapper(ServletResponse response) {
         if (response == null) {
             throw new IllegalArgumentException("Response cannot be null");
         }
         this. = response;
     }

    
Return the wrapped ServletResponse object.
 
     public ServletResponse getResponse() {
         return this.;
     }

    
Sets the response being wrapped.

Throws:
java.lang.IllegalArgumentException if the response is null.
 
     public void setResponse(ServletResponse response) {
         if (response == null) {
             throw new IllegalArgumentException("Response cannot be null");
         }
         this. = response;
     }

    
The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object.

Since:
Servlet 2.4
 
     public void setCharacterEncoding(String charset) {
         this..setCharacterEncoding(charset);
     }

    
The default behavior of this method is to return getCharacterEncoding() on the wrapped response object.
 
     public String getCharacterEncoding() {
         return this..getCharacterEncoding();
     }

    
The default behavior of this method is to return getOutputStream() on the wrapped response object.
 
     public ServletOutputStream getOutputStream() throws IOException {
         return this..getOutputStream();
     }

    
The default behavior of this method is to return getWriter() on the wrapped response object.
    public PrintWriter getWriter() throws IOException {
        return this..getWriter();
    }

    
The default behavior of this method is to call setContentLength(int len) on the wrapped response object.
    public void setContentLength(int len) {
        this..setContentLength(len);
    }

    
The default behavior of this method is to call setContentType(String type) on the wrapped response object.
    public void setContentType(String type) {
        this..setContentType(type);
    }

    
The default behavior of this method is to return getContentType() on the wrapped response object.

Since:
Servlet 2.4
    public String getContentType() {
        return this..getContentType();
    }

    
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object.
    public void setBufferSize(int size) {
        this..setBufferSize(size);
    }

    
The default behavior of this method is to return getBufferSize() on the wrapped response object.
    public int getBufferSize() {
        return this..getBufferSize();
    }

    
The default behavior of this method is to call flushBuffer() on the wrapped response object.
    public void flushBuffer() throws IOException {
        this..flushBuffer();
    }

    
The default behavior of this method is to return isCommitted() on the wrapped response object.
    public boolean isCommitted() {
        return this..isCommitted();
    }

    
The default behavior of this method is to call reset() on the wrapped response object.
    public void reset() {
        this..reset();
    }

    
The default behavior of this method is to call resetBuffer() on the wrapped response object.
    public void resetBuffer() {
        this..resetBuffer();
    }

    
The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object.
    public void setLocale(Locale loc) {
        this..setLocale(loc);
    }

    
The default behavior of this method is to return getLocale() on the wrapped response object.
    public Locale getLocale() {
        return this..getLocale();
    }
New to GrepCode? Check out our FAQ X