FileDocCategorySizeDatePackage
HttpResponseFacade.javaAPI DocGlassfish v2 API9935Fri May 04 22:31:54 BST 2007org.apache.catalina.connector

HttpResponseFacade

public final class HttpResponseFacade extends ResponseFacade implements HttpServletResponse
Facade class that wraps a Catalina-internal HttpResponse object. All methods are delegated to the wrapped response.
author
Remy Maucherat
author
Craig R. McClanahan
version
$Revision: 1.4 $ $Date: 2007/05/05 05:31:53 $

Fields Summary
private static final org.apache.catalina.util.StringManager
sm
The string manager for this package.
Constructors Summary
public HttpResponseFacade(org.apache.catalina.HttpResponse response)
Construct a wrapper for the specified response.

param
response The response to be wrapped



    // ----------------------------------------------------------- Constructors


                       
       
        super(response);
    
Methods Summary
public voidaddCookie(javax.servlet.http.Cookie cookie)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).addCookie(cookie);

    
public voidaddDateHeader(java.lang.String name, long date)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).addDateHeader(name, date);

    
public voidaddHeader(java.lang.String name, java.lang.String value)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).addHeader(name, value);

    
public voidaddIntHeader(java.lang.String name, int value)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).addIntHeader(name, value);

    
public booleancontainsHeader(java.lang.String name)

        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return ((HttpServletResponse) response).containsHeader(name);
    
public java.lang.StringencodeRedirectURL(java.lang.String url)

        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return ((HttpServletResponse) response).encodeRedirectURL(url);
    
public java.lang.StringencodeRedirectUrl(java.lang.String url)

        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return ((HttpServletResponse) response).encodeRedirectURL(url);
    
public java.lang.StringencodeURL(java.lang.String url)

        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return ((HttpServletResponse) response).encodeURL(url);
    
public java.lang.StringencodeUrl(java.lang.String url)

        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }
        return ((HttpServletResponse) response).encodeURL(url);
    
public voidsendError(int sc, java.lang.String msg)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            throw new IllegalStateException
                (/*sm.getString("responseBase.reset.ise")*/);

        resp.setAppCommitted(true);

        ((HttpServletResponse) response).sendError(sc, msg);

    
public voidsendError(int sc)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            throw new IllegalStateException
                (/*sm.getString("responseBase.reset.ise")*/);

        resp.setAppCommitted(true);

        ((HttpServletResponse) response).sendError(sc);

    
public voidsendRedirect(java.lang.String location)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            throw new IllegalStateException
                (/*sm.getString("responseBase.reset.ise")*/);

        resp.setAppCommitted(true);

        ((HttpServletResponse) response).sendRedirect(location);

    
public voidsetDateHeader(java.lang.String name, long date)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).setDateHeader(name, date);

    
public voidsetHeader(java.lang.String name, java.lang.String value)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).setHeader(name, value);

    
public voidsetIntHeader(java.lang.String name, int value)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).setIntHeader(name, value);

    
public voidsetStatus(int sc)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).setStatus(sc);

    
public voidsetStatus(int sc, java.lang.String s)


        // Disallow operation if the object has gone out of scope
        if (response == null) {
            throw new IllegalStateException(
                sm.getString("object.invalidScope"));
        }

        if (isCommitted())
            return;

        ((HttpServletResponse) response).setStatus(sc, s);