public class ShiroHttpServletResponse extends javax.servlet.http.HttpServletResponseWrapper
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
Constructor and Description |
---|
ShiroHttpServletResponse(javax.servlet.http.HttpServletResponse wrapped,
javax.servlet.ServletContext context,
ShiroHttpServletRequest request) |
Modifier and Type | Method and Description |
---|---|
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.
|
javax.servlet.ServletContext |
getContext() |
ShiroHttpServletRequest |
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(javax.servlet.ServletContext context) |
void |
setRequest(ShiroHttpServletRequest request) |
protected String |
toEncoded(String url,
String sessionId)
Return the specified URL with the specified session identifier suitably encoded.
|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, sendError, sendError, sendRedirect, setDateHeader, setHeader, setIntHeader, setStatus, setStatus
flushBuffer, getBufferSize, getCharacterEncoding, getLocale, getOutputStream, getResponse, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setContentLength, setContentType, setLocale, setResponse
public ShiroHttpServletResponse(javax.servlet.http.HttpServletResponse wrapped, javax.servlet.ServletContext context, ShiroHttpServletRequest request)
public javax.servlet.ServletContext getContext()
public void setContext(javax.servlet.ServletContext context)
public ShiroHttpServletRequest getRequest()
public void setRequest(ShiroHttpServletRequest request)
public String encodeRedirectURL(String url)
encodeRedirectURL
in interface javax.servlet.http.HttpServletResponse
encodeRedirectURL
in class javax.servlet.http.HttpServletResponseWrapper
url
- URL to be encodedpublic String encodeRedirectUrl(String s)
encodeRedirectUrl
in interface javax.servlet.http.HttpServletResponse
encodeRedirectUrl
in class javax.servlet.http.HttpServletResponseWrapper
public String encodeURL(String url)
encodeURL
in interface javax.servlet.http.HttpServletResponse
encodeURL
in class javax.servlet.http.HttpServletResponseWrapper
url
- URL to be encodedpublic String encodeUrl(String s)
encodeUrl
in interface javax.servlet.http.HttpServletResponse
encodeUrl
in class javax.servlet.http.HttpServletResponseWrapper
protected 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 validatedtrue
if the specified URL should be encoded with a session identifier, false
otherwise.public static boolean isSchemeChar(char c)
c
- the character to checktrue
if the character is allowed in a URI scheme, false
otherwise.protected String toEncoded(String url, String sessionId)
url
- URL to be encoded with the session idsessionId
- Session id to be included in the encoded URLCopyright © 2004–2019 The Apache Software Foundation. All rights reserved.