public interface RebelHttpServletResponse
Separate interface is required as the javax.servlet.http.HttpServletResponse
interface is not loaded by the boot class loader.
In practice a bytecode processor makes javax.servlet.http.HttpServletResponse
to extend the given interface.
ServletIntegration| Modifier and Type | Method and Description |
|---|---|
String |
encodeRedirectUrl(String url)
Deprecated.
As of version 2.1, use
encodeRedirectURL(String url) instead
|
String |
encodeRedirectURL(String url)
Encodes the specified URL for use in the
sendRedirect method
or, if encoding is not needed,
returns the URL unchanged. |
String |
encodeUrl(String url)
Deprecated.
As of version 2.1, use encodeURL(String url) instead
|
String |
encodeURL(String url)
Encodes the specified URL by including the session ID in it,
or, if encoding is not needed, returns the URL unchanged.
|
void |
sendError(int sc)
Sends an error response to the client using the specified status
code and clearing the buffer.
|
void |
sendError(int sc,
String msg)
Sends an error response to the client using the specified
status.
|
void |
sendRedirect(String location)
Sends a temporary redirect response to the client using the
specified redirect location URL.
|
String encodeURL(String url)
For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
url - the url to be encoded.String encodeRedirectURL(String url)
sendRedirect method
or, if encoding is not needed,
returns the URL unchanged. The implementation of this method
includes the logic to determine whether the session ID
needs to be encoded in the URL. Because the rules for making
this determination can differ from those used to decide whether to
encode a normal link, this method is separated from the
encodeURL method.
All URLs sent to the HttpServletResponse.sendRedirect method
should be run through this method. Otherwise, URL rewriting cannot be used
with browsers which do not support cookies.
url - the url to be encoded.sendRedirect(java.lang.String),
encodeUrl(java.lang.String)String encodeUrl(String url)
url - the url to be encoded.String encodeRedirectUrl(String url)
url - the url to be encoded.void sendError(int sc,
String msg)
throws IOException
If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
sc - the error status codemsg - the descriptive messageIOException - If an input or output exception occursIllegalStateException - If the response was committedvoid sendError(int sc)
throws IOException
If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
sc - the error status codeIOException - If an input or output exception occursIllegalStateException - If the response was committed
before this method callvoid sendRedirect(String location) throws IOException
If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
location - the redirect location URLIOException - If an input or output exception occursIllegalStateException - If the response was committed or
if a partial URL is given and cannot be converted into a valid
URLCopyright © 2017. All rights reserved.