javax.servlet.http

Class HttpServletResponseWrapper

public class HttpServletResponseWrapper extends ServletResponseWrapper implements HttpServletResponse

Provides a convenient implementation of the HttpServletResponse 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.

Since: v 2.3

Version: $Version$

Author: Various

See Also:

Constructor Summary
HttpServletResponseWrapper(HttpServletResponse response)
Constructs a response adaptor wrapping the given response.
Method Summary
voidaddCookie(Cookie cookie)
The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object.
voidaddDateHeader(String name, long date)
The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object.
voidaddHeader(String name, String value)
The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.
voidaddIntHeader(String name, int value)
The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object.
booleancontainsHeader(String name)
The default behavior of this method is to call containsHeader(String name) on the wrapped response object.
StringencodeRedirectUrl(String url)
The default behavior of this method is to return encodeRedirectUrl(String url) on the wrapped response object.
StringencodeRedirectURL(String url)
The default behavior of this method is to return encodeRedirectURL(String url) on the wrapped response object.
StringencodeUrl(String url)
The default behavior of this method is to call encodeUrl(String url) on the wrapped response object.
StringencodeURL(String url)
The default behavior of this method is to call encodeURL(String url) on the wrapped response object.
voidsendError(int sc, String msg)
The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.
voidsendError(int sc)
The default behavior of this method is to call sendError(int sc) on the wrapped response object.
voidsendRedirect(String location)
The default behavior of this method is to return sendRedirect(String location) on the wrapped response object.
voidsetDateHeader(String name, long date)
The default behavior of this method is to call setDateHeader(String name, long date) on the wrapped response object.
voidsetHeader(String name, String value)
The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.
voidsetIntHeader(String name, int value)
The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.
voidsetStatus(int sc)
The default behavior of this method is to call setStatus(int sc) on the wrapped response object.
voidsetStatus(int sc, String sm)
The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object.

Constructor Detail

HttpServletResponseWrapper

public HttpServletResponseWrapper(HttpServletResponse response)
Constructs a response adaptor wrapping the given response.

Throws: java.lang.IllegalArgumentException if the response is null

Method Detail

addCookie

public void addCookie(Cookie cookie)
The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object.

addDateHeader

public void addDateHeader(String name, long date)
The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object.

addHeader

public void addHeader(String name, String value)
The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.

addIntHeader

public void addIntHeader(String name, int value)
The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object.

containsHeader

public boolean containsHeader(String name)
The default behavior of this method is to call containsHeader(String name) on the wrapped response object.

encodeRedirectUrl

public String encodeRedirectUrl(String url)
The default behavior of this method is to return encodeRedirectUrl(String url) on the wrapped response object.

encodeRedirectURL

public String encodeRedirectURL(String url)
The default behavior of this method is to return encodeRedirectURL(String url) on the wrapped response object.

encodeUrl

public String encodeUrl(String url)
The default behavior of this method is to call encodeUrl(String url) on the wrapped response object.

encodeURL

public String encodeURL(String url)
The default behavior of this method is to call encodeURL(String url) on the wrapped response object.

sendError

public void sendError(int sc, String msg)
The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.

sendError

public void sendError(int sc)
The default behavior of this method is to call sendError(int sc) on the wrapped response object.

sendRedirect

public void sendRedirect(String location)
The default behavior of this method is to return sendRedirect(String location) on the wrapped response object.

setDateHeader

public void setDateHeader(String name, long date)
The default behavior of this method is to call setDateHeader(String name, long date) on the wrapped response object.

setHeader

public void setHeader(String name, String value)
The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.

setIntHeader

public void setIntHeader(String name, int value)
The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.

setStatus

public void setStatus(int sc)
The default behavior of this method is to call setStatus(int sc) on the wrapped response object.

setStatus

public void setStatus(int sc, String sm)
The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object.
Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.