|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.ServletResponseWrapper
javax.servlet.http.HttpServletResponseWrapper
org.jsecurity.web.servlet.JSecurityHttpServletResponse
public class JSecurityHttpServletResponse
HttpServletResponse implementation to support URL Encoding of JSecurity Session IDs. It is only used when using JSecurity's native Session Management configuration (and not when using the Servlet Container session configuration, which is JSecurity's default in a web environment). Because the servlet container already performs url encoding of its own session ids, instances of this class are only needed when using JSecurity native sessions.
Note that this implementation relies in part on source code from the Tomcat 6.x distribution for encoding URLs for session ID URL Rewriting (we didn't want to re-invent the wheel). Since JSecurity is also Apache 2.0 license, all regular licenses and conditions have remained in tact.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
JSecurityHttpServletResponse(HttpServletResponse wrapped,
ServletContext context,
JSecurityHttpServletRequest request)
|
|
| Method Summary | |
|---|---|
String |
encodeRedirectUrl(String s)
|
String |
encodeRedirectURL(String url)
Encode the session identifier associated with this response into the specified redirect URL, if necessary. |
String |
encodeUrl(String s)
|
String |
encodeURL(String url)
Encode the session identifier associated with this response into the specified URL, if necessary. |
ServletContext |
getContext()
|
JSecurityHttpServletRequest |
getRequest()
|
protected boolean |
isEncodeable(String location)
Return true if the specified URL should be encoded with
a session identifier. |
static boolean |
isSchemeChar(char c)
Determine if the character is allowed in the scheme of a URI. |
void |
setContext(ServletContext context)
|
void |
setRequest(JSecurityHttpServletRequest request)
|
protected String |
toEncoded(String url,
String sessionId)
Return the specified URL with the specified session identifier suitably encoded. |
| Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
|---|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, sendError, sendError, sendRedirect, 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 JSecurityHttpServletResponse(HttpServletResponse wrapped,
ServletContext context,
JSecurityHttpServletRequest request)
| Method Detail |
|---|
public ServletContext getContext()
public void setContext(ServletContext context)
public JSecurityHttpServletRequest getRequest()
public void setRequest(JSecurityHttpServletRequest request)
public String encodeRedirectURL(String url)
encodeRedirectURL in interface HttpServletResponseencodeRedirectURL in class HttpServletResponseWrapperurl - URL to be encodedpublic String encodeRedirectUrl(String s)
encodeRedirectUrl in interface HttpServletResponseencodeRedirectUrl in class HttpServletResponseWrapperpublic String encodeURL(String url)
encodeURL in interface HttpServletResponseencodeURL in class HttpServletResponseWrapperurl - URL to be encodedpublic String encodeUrl(String s)
encodeUrl in interface HttpServletResponseencodeUrl in class HttpServletResponseWrapperprotected boolean isEncodeable(String location)
true if the specified URL should be encoded with
a session identifier. This will be true if all of the following
conditions are met:
location - Absolute URL to be validatedpublic static boolean isSchemeChar(char c)
protected String toEncoded(String url,
String sessionId)
url - URL to be encoded with the session idsessionId - Session id to be included in the encoded URL
|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||