#include <HttpServletResponseWrapper.h>
Public Member Functions | |
HttpServletResponseWrapper (HttpServletResponse *response) | |
virtual void | addCookie (const Cookie &cookie) |
virtual bool | containsHeader (const std::string &name) const |
virtual std::string | encodeURL (const std::string &url) |
virtual std::string | encodeRedirectURL (const std::string &url) |
virtual void | sendError (int sc, const std::string &msg) |
virtual void | sendError (int sc) |
virtual void | sendRedirect (const std::string &location) |
virtual void | setDateHeader (const std::string &name, long date) |
virtual void | addDateHeader (const std::string &name, long date) |
virtual void | setHeader (const std::string &name, const std::string &value) |
virtual void | addHeader (const std::string &name, const std::string &value) |
virtual void | setIntHeader (const std::string &name, int value) |
virtual void | addIntHeader (const std::string &name, int value) |
virtual void | setStatus (int sc) |
Private Member Functions | |
HttpServletResponse * | _getHttpServletResponse () |
const HttpServletResponse * | _getHttpServletResponse () const |
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.
Definition at line 42 of file HttpServletResponseWrapper.h.
servlet::HttpServletResponseWrapper::HttpServletResponseWrapper | ( | HttpServletResponse * | response | ) | [inline] |
Constructs a response adaptor wrapping the given response.
java.lang.IllegalArgumentException | if the response is null |
Definition at line 58 of file HttpServletResponseWrapper.h.
const HttpServletResponse* servlet::HttpServletResponseWrapper::_getHttpServletResponse | ( | ) | const [inline, private] |
Definition at line 49 of file HttpServletResponseWrapper.h.
References servlet::ServletResponseWrapper::getResponse().
HttpServletResponse* servlet::HttpServletResponseWrapper::_getHttpServletResponse | ( | ) | [inline, private] |
Definition at line 46 of file HttpServletResponseWrapper.h.
References servlet::ServletResponseWrapper::getResponse().
Referenced by addCookie(), addDateHeader(), addHeader(), addIntHeader(), containsHeader(), encodeRedirectURL(), encodeURL(), sendError(), sendRedirect(), setDateHeader(), setHeader(), setIntHeader(), and setStatus().
virtual void servlet::HttpServletResponseWrapper::addCookie | ( | const Cookie & | cookie | ) | [inline, virtual] |
The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 66 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::addCookie().
virtual void servlet::HttpServletResponseWrapper::addDateHeader | ( | const std::string & | name, | |
long | date | |||
) | [inline, virtual] |
The default behavior of this method is to call addDateHeader(std::string name, long date) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 131 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::addDateHeader().
virtual void servlet::HttpServletResponseWrapper::addHeader | ( | const std::string & | name, | |
const std::string & | value | |||
) | [inline, virtual] |
The default behavior of this method is to return addHeader(const std::string& name, std::string value) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 147 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::addHeader().
virtual void servlet::HttpServletResponseWrapper::addIntHeader | ( | const std::string & | name, | |
int | value | |||
) | [inline, virtual] |
The default behavior of this method is to call addIntHeader(const std::string& name, int value) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 163 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::addIntHeader().
virtual bool servlet::HttpServletResponseWrapper::containsHeader | ( | const std::string & | name | ) | const [inline, virtual] |
The default behavior of this method is to call containsHeader(std::string name) on the wrapped response object.
Implements servlet::HttpServletResponse.
Definition at line 74 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::containsHeader().
virtual std::string servlet::HttpServletResponseWrapper::encodeRedirectURL | ( | const std::string & | url | ) | [inline, virtual] |
The default behavior of this method is to return encodeRedirectURL(std::string url) on the wrapped response object.
Implements servlet::HttpServletResponse.
Definition at line 90 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::encodeRedirectURL().
virtual std::string servlet::HttpServletResponseWrapper::encodeURL | ( | const std::string & | url | ) | [inline, virtual] |
The default behavior of this method is to call encodeURL(std::string url) on the wrapped response object.
Implements servlet::HttpServletResponse.
Definition at line 82 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::encodeURL().
virtual void servlet::HttpServletResponseWrapper::sendError | ( | int | sc | ) | [inline, virtual] |
The default behavior of this method is to call sendError(int sc) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 107 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::sendError().
virtual void servlet::HttpServletResponseWrapper::sendError | ( | int | sc, | |
const std::string & | msg | |||
) | [inline, virtual] |
The default behavior of this method is to call sendError(int sc, std::string msg) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 98 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::sendError().
virtual void servlet::HttpServletResponseWrapper::sendRedirect | ( | const std::string & | location | ) | [inline, virtual] |
The default behavior of this method is to return sendRedirect(std::string location) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 115 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::sendRedirect().
virtual void servlet::HttpServletResponseWrapper::setDateHeader | ( | const std::string & | name, | |
long | date | |||
) | [inline, virtual] |
The default behavior of this method is to call setDateHeader(std::string name, long date) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 123 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::setDateHeader().
virtual void servlet::HttpServletResponseWrapper::setHeader | ( | const std::string & | name, | |
const std::string & | value | |||
) | [inline, virtual] |
The default behavior of this method is to return setHeader(const std::string& name, std::string value) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 139 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::setHeader().
virtual void servlet::HttpServletResponseWrapper::setIntHeader | ( | const std::string & | name, | |
int | value | |||
) | [inline, virtual] |
The default behavior of this method is to call setIntHeader(const std::string& name, int value) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 155 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::setIntHeader().
virtual void servlet::HttpServletResponseWrapper::setStatus | ( | int | sc | ) | [inline, virtual] |
The default behavior of this method is to call setStatus(int sc) on the wrapped response object.
Implements servlet::HttpServletResponse.
Reimplemented in container::IncludedResponseWrapper.
Definition at line 173 of file HttpServletResponseWrapper.h.
References _getHttpServletResponse(), and servlet::HttpServletResponse::setStatus().