| java.lang.Object javax.servlet.ServletResponseWrapper javax.servlet.http.HttpServletResponseWrapper
HttpServletResponseWrapper | public class HttpServletResponseWrapper extends ServletResponseWrapper implements HttpServletResponse(Code) | | Wraps a servlet request in another request. Filters may
use HttpServletResponseWrapper to modify the headers passed to the servlet.
The default methods just call the wrapped request methods.
since: servlet 2.3 |
HttpServletResponseWrapper | public HttpServletResponseWrapper(HttpServletResponse response)(Code) | | Creates a new Response wrapper
Parameters: response - the wrapped response |
addCookie | public void addCookie(Cookie cookie)(Code) | | Sends a new cookie to the client.
|
addDateHeader | public void addDateHeader(String name, long date)(Code) | | Adds a header by converting a date to a string.
Parameters: name - name of the header Parameters: date - the date in milliseconds since the epoch. |
addHeader | public void addHeader(String name, String value)(Code) | | Adds a header. If another header with the same name exists, both
will be sent to the client.
Parameters: name - the header name Parameters: value - the header value |
addIntHeader | public void addIntHeader(String name, int value)(Code) | | Adds a header by converting an integer value to a string.
Parameters: name - name of the header Parameters: value - the value as an integer |
containsHeader | public boolean containsHeader(String name)(Code) | | Returns true if the output headers include name
Parameters: name - the header name to test |
encodeRedirectURL | public String encodeRedirectURL(String name)(Code) | | Encodes session information in a URL suitable for
sendRedirect()
Parameters: url - the url to encode a url with session information encoded |
encodeURL | public String encodeURL(String url)(Code) | | Encodes session information in a URL. Calling this will enable
sessions for users who have disabled cookies.
Parameters: url - the url to encode a url with session information encoded |
sendError | public void sendError(int sc, String msg) throws IOException(Code) | | Sends an HTTP error page based on the status code
Parameters: sc - the HTTP status code |
sendError | public void sendError(int sc) throws IOException(Code) | | Sends an HTTP error page based on the status code
Parameters: sc - the HTTP status code |
sendRedirect | public void sendRedirect(String location) throws IOException(Code) | | Redirects the client to another page.
Parameters: location - the location to redirect to. |
setDateHeader | public void setDateHeader(String name, long date)(Code) | | Sets a header by converting a date to a string.
To set the page to expire in 15 seconds use the following:
long now = System.currentTime();
response.setDateHeader("Expires", now + 15000);
Parameters: name - name of the header Parameters: date - the date in milliseconds since the epoch. |
setHeader | public void setHeader(String name, String value)(Code) | | Sets a header. This will override a previous header
with the same name.
Parameters: name - the header name Parameters: value - the header value |
setIntHeader | public void setIntHeader(String name, int value)(Code) | | Sets a header by converting an integer value to a string.
Parameters: name - name of the header Parameters: value - the value as an integer |
setResponse | public void setResponse(ServletResponse response)(Code) | | Sets a response object.
Parameters: response - the response object |
setStatus | public void setStatus(int sc)(Code) | | Sets the HTTP status
Parameters: sc - the HTTP status code |
|
|