public class CacheHttpServletRequest
extends javax.servlet.http.HttpServletRequestWrapper
CacheHttpSession的HttpSession实例。
判断Session是否为失效超过最大不活动时间的时机是每次获取Session时。
比如getSession()和getSession(true)都将造成更新最后访问时间。
但是getSession(false)被调用时,如果本身没有绑定Session那么不会有这个动作。| 构造器和说明 |
|---|
CacheHttpServletRequest(javax.servlet.http.HttpServletRequest request,
String sessionId)
构造一个HttpServletRequest的包装器。
|
| 限定符和类型 | 方法和说明 |
|---|---|
javax.servlet.http.HttpSession |
getSession()
获取会话实例,如果不存在则创建。
|
javax.servlet.http.HttpSession |
getSession(boolean create)
获取会话实例,调用者指定如果不存在时是否创建一个新的。
|
void |
sync()
如果Session不为空,同步至缓存。
|
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, 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, startAsyncgetAsyncContext, 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 CacheHttpServletRequest(javax.servlet.http.HttpServletRequest request,
String sessionId)
public javax.servlet.http.HttpSession getSession()
getSession 在接口中 javax.servlet.http.HttpServletRequestgetSession 在类中 javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession 在接口中 javax.servlet.http.HttpServletRequestgetSession 在类中 javax.servlet.http.HttpServletRequestWrappercreate - true不存在则创建,false不存在返回null.public void sync()
Copyright © 2021. All rights reserved.