public class SessionPipelineServlet extends PipelineableServletImpl
This adds an attribute factory for the HttpSessionRequest object that contains session information about this request's session. The attribute is javax.servlet.http.HttpSessionRequest.
The first time this attribute is accessed, it will examine the request's URL arguments and cookies for a session id, and will then find or create the session. It will also send back a cookie in the case where a cookie is needed. Note that all of this happens only the first time the attribute is accessed, not necessarily at the time the request runs through this servlet. This servlet does nothing more than register an attribute factory. There is, however, a property called "accessSessionImmediately" that, if true, will cause the session to be accessed at the same time that the request passes through this servlet. If that flag is false, then the session access is delayed until the first access. By default, this flag is set to true.
The session request attribute should be accessed after the request has run through a URLArgumentPipelineServlet and a CookiePipelineServlet, and before any output is rendered (because it might need to send a cookie).
Note that if the attribute is never accessed, then the session will never be accessed or created, nor will a cookie be sent out. Remember that by default, this servlet will access the session as soon as the request runs through this servlet. You must turn accessSessionImmediately to false to delay access of the session.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
SessionPipelineServlet()
Constructs a new SessionPipelineServlet
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAccessSessionImmediately()
Returns the flag indicating if the session should be accessed
immediately when the request runs through this pipeline element.
|
java.lang.String |
getErrorURL()
Returns the errorURL property
|
atg.servlet.sessiontracking.SessionManagerService |
getSessionManager()
Returns the SessionManager
|
HttpSessionRequest |
getSessionRequest(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Returns the SessionRequest
|
boolean |
isAdminPipeline()
Returns flag determining whether this component is part of
the admin pipeline or not.
|
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Services a DynamoHttpServletRequest/Response pair
|
void |
setAccessSessionImmediately(boolean pAccessSessionImmediately)
Sets the flag indicating if the session should be accessed
immediately when the request runs through this pipeline element.
|
void |
setAdminPipeline(boolean pIsAdminPipeline)
Set flag to denote whether this component is part of
the admin pipeline or not.
|
void |
setErrorURL(java.lang.String pErrorURL)
A URL to redirect the request to if the session limit has been
exceeded
|
void |
setSessionManager(atg.servlet.sessiontracking.SessionManagerService pSessionManager)
Sets the SessionManager
|
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
addLogListener, doStartService, doStopService, getAbsoluteName, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public SessionPipelineServlet()
public HttpSessionRequest getSessionRequest(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
public atg.servlet.sessiontracking.SessionManagerService getSessionManager()
public void setSessionManager(atg.servlet.sessiontracking.SessionManagerService pSessionManager)
public boolean getAccessSessionImmediately()
public void setAccessSessionImmediately(boolean pAccessSessionImmediately)
public void setErrorURL(java.lang.String pErrorURL)
public java.lang.String getErrorURL()
public void setAdminPipeline(boolean pIsAdminPipeline)
pIsAdminPipeline
- true if part of admin pipeline.public boolean isAdminPipeline()
public void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
service
in class PipelineableServletImpl
javax.servlet.ServletException
- if an error occurred while processing
the servlet requestjava.io.IOException
- if an error occurred while reading or writing
the servlet request