public class ShiroHttpServletRequest
extends javax.servlet.http.HttpServletRequestWrapper
ShiroHttpServletRequest wraps the Servlet container's original ServletRequest instance, but ensures
that all HttpServletRequest invocations that require Shiro's support (getRemoteUser,
getSession, etc) can be executed first by Shiro as necessary before allowing the underlying
Servlet container instance's method to be invoked.| Modifier and Type | Field and Description |
|---|---|
static String |
COOKIE_SESSION_ID_SOURCE |
protected boolean |
httpSessions |
static String |
IDENTITY_REMOVED_KEY |
static String |
REFERENCED_SESSION_ID |
static String |
REFERENCED_SESSION_ID_IS_VALID |
static String |
REFERENCED_SESSION_ID_SOURCE |
static String |
REFERENCED_SESSION_IS_NEW |
protected javax.servlet.ServletContext |
servletContext |
protected javax.servlet.http.HttpSession |
session |
static String |
SESSION_ID_URL_REWRITING_ENABLED |
static String |
URL_SESSION_ID_SOURCE |
| Constructor and Description |
|---|
ShiroHttpServletRequest(javax.servlet.http.HttpServletRequest wrapped,
javax.servlet.ServletContext servletContext,
boolean httpSessions) |
| Modifier and Type | Method and Description |
|---|---|
String |
getRemoteUser() |
String |
getRequestedSessionId() |
javax.servlet.http.HttpSession |
getSession() |
javax.servlet.http.HttpSession |
getSession(boolean create) |
protected org.apache.shiro.subject.Subject |
getSubject() |
protected Object |
getSubjectPrincipal() |
Principal |
getUserPrincipal() |
boolean |
isHttpSessions() |
boolean |
isRequestedSessionIdFromCookie() |
boolean |
isRequestedSessionIdFromUrl() |
boolean |
isRequestedSessionIdFromURL() |
boolean |
isRequestedSessionIdValid() |
boolean |
isUserInRole(String s) |
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRequestURI, getRequestURL, getServletPath, login, logout, upgradegetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsyncpublic static final String COOKIE_SESSION_ID_SOURCE
public static final String URL_SESSION_ID_SOURCE
public static final String REFERENCED_SESSION_ID
public static final String REFERENCED_SESSION_ID_IS_VALID
public static final String REFERENCED_SESSION_IS_NEW
public static final String REFERENCED_SESSION_ID_SOURCE
public static final String IDENTITY_REMOVED_KEY
public static final String SESSION_ID_URL_REWRITING_ENABLED
protected javax.servlet.ServletContext servletContext
protected javax.servlet.http.HttpSession session
protected boolean httpSessions
public ShiroHttpServletRequest(javax.servlet.http.HttpServletRequest wrapped,
javax.servlet.ServletContext servletContext,
boolean httpSessions)
public boolean isHttpSessions()
public String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestgetRemoteUser in class javax.servlet.http.HttpServletRequestWrapperprotected org.apache.shiro.subject.Subject getSubject()
protected Object getSubjectPrincipal()
public boolean isUserInRole(String s)
isUserInRole in interface javax.servlet.http.HttpServletRequestisUserInRole in class javax.servlet.http.HttpServletRequestWrapperpublic Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestgetUserPrincipal in class javax.servlet.http.HttpServletRequestWrapperpublic String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestgetRequestedSessionId in class javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession in interface javax.servlet.http.HttpServletRequestgetSession in class javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestgetSession in class javax.servlet.http.HttpServletRequestWrapperpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestisRequestedSessionIdValid in class javax.servlet.http.HttpServletRequestWrapperpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestisRequestedSessionIdFromCookie in class javax.servlet.http.HttpServletRequestWrapperpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestisRequestedSessionIdFromURL in class javax.servlet.http.HttpServletRequestWrapperpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestisRequestedSessionIdFromUrl in class javax.servlet.http.HttpServletRequestWrapperCopyright © 2004–2017 The Apache Software Foundation. All rights reserved.