FileDocCategorySizeDatePackage
ApplicationHttpResponse.javaAPI DocGlassfish v2 API11216Fri May 04 22:31:54 BST 2007org.apache.catalina.core

ApplicationHttpResponse

public class ApplicationHttpResponse extends HttpServletResponseWrapper
PWC 4858179 class ApplicationHttpResponse extends HttpServletResponseWrapper {

Fields Summary
protected boolean
included
Is this wrapped response the subject of an include() call?
protected static final String
info
Descriptive information about this implementation.
protected static final org.apache.catalina.util.StringManager
sm
The string manager for this package.
Constructors Summary
public ApplicationHttpResponse(HttpServletResponse response)
Construct a new wrapped response around the specified servlet response.

param
response The servlet response being wrapped


        this(response, false);

    
public ApplicationHttpResponse(HttpServletResponse response, boolean included)
Construct a new wrapped response around the specified servlet response.

param
response The servlet response being wrapped
param
included true if this response is being processed by a RequestDispatcher.include() call


        super(response);
        setIncluded(included);

    
Methods Summary
public voidaddCookie(javax.servlet.http.Cookie cookie)
Disallow addCookie() calls on an included response.

param
cookie The new cookie


        if (!included)
            ((HttpServletResponse) getResponse()).addCookie(cookie);

    
public voidaddDateHeader(java.lang.String name, long value)
Disallow addDateHeader() calls on an included response.

param
name The new header name
param
value The new header value


        if (!included)
            ((HttpServletResponse) getResponse()).addDateHeader(name, value);

    
public voidaddHeader(java.lang.String name, java.lang.String value)
Disallow addHeader() calls on an included response.

param
name The new header name
param
value The new header value


        if (!included)
            ((HttpServletResponse) getResponse()).addHeader(name, value);

    
public voidaddIntHeader(java.lang.String name, int value)
Disallow addIntHeader() calls on an included response.

param
name The new header name
param
value The new header value


        if (!included)
            ((HttpServletResponse) getResponse()).addIntHeader(name, value);

    
public java.lang.StringgetInfo()
Return descriptive information about this implementation.


        return (this.info);

    
public booleanisIncluded()
Return the included flag for this response.


        return (this.included);

    
public voidreset()
Disallow reset() calls on a included response.

exception
IllegalStateException if the response has already been committed



    // ------------------------------------------------ ServletResponse Methods


                          
       

        // If already committed, the wrapped response will throw ISE
        if (!included || getResponse().isCommitted())
            getResponse().reset();

    
public voidsendError(int sc)
Disallow sendError() calls on an included response.

param
sc The new status code
exception
IOException if an input/output error occurs


        if (!included)
            ((HttpServletResponse) getResponse()).sendError(sc);

    
public voidsendError(int sc, java.lang.String msg)
Disallow sendError() calls on an included response.

param
sc The new status code
param
msg The new message
exception
IOException if an input/output error occurs


        if (!included)
            ((HttpServletResponse) getResponse()).sendError(sc, msg);

    
public voidsendRedirect(java.lang.String location)
Disallow sendRedirect() calls on an included response.

param
location The new location
exception
IOException if an input/output error occurs


        if (!included)
            ((HttpServletResponse) getResponse()).sendRedirect(location);

    
public voidsetBufferSize(int size)
Ignore setBufferSize() calls on an included response.

param
size The buffer size

        if (!included)
            getResponse().setBufferSize(size);
    
public voidsetContentLength(int len)
Disallow setContentLength() calls on an included response.

param
len The new content length


        if (!included)
            getResponse().setContentLength(len);

    
public voidsetContentType(java.lang.String type)
Disallow setContentType() calls on an included response.

param
type The new content type


        if (!included)
            getResponse().setContentType(type);

    
public voidsetDateHeader(java.lang.String name, long value)
Disallow setDateHeader() calls on an included response.

param
name The new header name
param
value The new header value


        if (!included)
            ((HttpServletResponse) getResponse()).setDateHeader(name, value);

    
public voidsetHeader(java.lang.String name, java.lang.String value)
Disallow setHeader() calls on an included response.

param
name The new header name
param
value The new header value


        if (!included)
            ((HttpServletResponse) getResponse()).setHeader(name, value);

    
voidsetIncluded(boolean included)
Set the included flag for this response.

param
included The new included flag


        this.included = included;

    
public voidsetIntHeader(java.lang.String name, int value)
Disallow setIntHeader() calls on an included response.

param
name The new header name
param
value The new header value


        if (!included)
            ((HttpServletResponse) getResponse()).setIntHeader(name, value);

    
public voidsetLocale(java.util.Locale loc)
Disallow setLocale() calls on an included response.

param
loc The new locale


        if (!included)
            getResponse().setLocale(loc);

    
voidsetResponse(javax.servlet.http.HttpServletResponse response)
Set the response that we are wrapping.

param
response The new wrapped response


        super.setResponse(response);

    
public voidsetStatus(int sc)
Disallow setStatus() calls on an included response.

param
sc The new status code


        if (!included)
            ((HttpServletResponse) getResponse()).setStatus(sc);

    
public voidsetStatus(int sc, java.lang.String msg)
Disallow setStatus() calls on an included response.

param
sc The new status code
param
msg The new message


        if (!included)
            ((HttpServletResponse) getResponse()).setStatus(sc, msg);