|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.ServletResponseWrapper javax.servlet.http.HttpServletResponseWrapper org.springframework.security.web.context.SaveContextOnUpdateOrErrorResponseWrapper
public abstract class SaveContextOnUpdateOrErrorResponseWrapper
Base class for response wrappers which encapsulate the logic for storing a security context and which
store the with the SecurityContext
when a sendError()
or sendRedirect
happens. See issue SEC-398.
Sub-classes should implement the saveContext(SecurityContext context)
method.
Support is also provided for disabling URL rewriting
Field Summary |
---|
Constructor Summary | |
---|---|
SaveContextOnUpdateOrErrorResponseWrapper(HttpServletResponse response,
boolean disableUrlRewriting)
|
Method Summary | |
---|---|
String |
encodeRedirectUrl(String url)
|
String |
encodeRedirectURL(String url)
|
String |
encodeUrl(String url)
|
String |
encodeURL(String url)
|
boolean |
isContextSaved()
Tells if the response wrapper has called saveContext() because of an error or redirect. |
void |
sendError(int sc)
Makes sure the session is updated before calling the superclass sendError() |
void |
sendError(int sc,
String msg)
Makes sure the session is updated before calling the superclass sendError() |
void |
sendRedirect(String location)
Makes sure the context is stored before calling the superclass sendRedirect() |
Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
---|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, setDateHeader, setHeader, setIntHeader, setStatus, setStatus |
Methods inherited from class javax.servlet.ServletResponseWrapper |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getResponse, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale, setResponse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.ServletResponse |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale |
Constructor Detail |
---|
public SaveContextOnUpdateOrErrorResponseWrapper(HttpServletResponse response, boolean disableUrlRewriting)
response
- the response to be wrappeddisableUrlRewriting
- turns the URL encoding methods into null operations, preventing the use
of URL rewriting to add the session identifier as a URL parameter.Method Detail |
---|
public final void sendError(int sc) throws IOException
sendError()
sendError
in interface HttpServletResponse
sendError
in class HttpServletResponseWrapper
IOException
public final void sendError(int sc, String msg) throws IOException
sendError()
sendError
in interface HttpServletResponse
sendError
in class HttpServletResponseWrapper
IOException
public final void sendRedirect(String location) throws IOException
sendRedirect()
sendRedirect
in interface HttpServletResponse
sendRedirect
in class HttpServletResponseWrapper
IOException
public final String encodeRedirectUrl(String url)
encodeRedirectUrl
in interface HttpServletResponse
encodeRedirectUrl
in class HttpServletResponseWrapper
public final String encodeRedirectURL(String url)
encodeRedirectURL
in interface HttpServletResponse
encodeRedirectURL
in class HttpServletResponseWrapper
public final String encodeUrl(String url)
encodeUrl
in interface HttpServletResponse
encodeUrl
in class HttpServletResponseWrapper
public final String encodeURL(String url)
encodeURL
in interface HttpServletResponse
encodeURL
in class HttpServletResponseWrapper
public final boolean isContextSaved()
saveContext()
because of an error or redirect.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |