|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.action.RequestProcessor org.apache.struts.tiles.TilesRequestProcessor com.softslate.commerce.customer.core.BaseRequestProcessor
public class BaseRequestProcessor
Subclass of TilesRequestProcessor
that negotiates each
application request. The subclasses of this class,
CustomerRequestProcessor
and
AdministratorRequestProcessor
, are specified in the
<controller> tags of the struts-config.xml
files, as the
request processors for the customer and adminstrator applications
respectively.
Field Summary | |
---|---|
(package private) static org.apache.commons.logging.Log |
adminAuditLog
|
(package private) static org.apache.commons.logging.Log |
customerAuditLog
|
static java.lang.String |
errorPath
Path to forward the request to if an error occurs when connecting to the database. |
static java.lang.String |
installerPath
Path to forward the request to if the installer is not locked. |
(package private) static org.apache.commons.logging.Log |
log
|
Fields inherited from class org.apache.struts.tiles.TilesRequestProcessor |
---|
definitionsFactory |
Fields inherited from class org.apache.struts.action.RequestProcessor |
---|
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet |
Constructor Summary | |
---|---|
BaseRequestProcessor()
|
Method Summary | |
---|---|
protected void |
doForward(java.lang.String uri,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Overrides the regular forward to use the user's custom layout. |
java.lang.String |
getExceptionAsString(java.lang.Throwable exception)
Recursively loops through a given exception and its causes, and returns a string containing all of the chained exceptions' stack traces. |
java.lang.String |
getRequestParamsDebugMessage(javax.servlet.http.HttpServletRequest request)
Given a request object, converts all the incoming parameters to a string for debugging. |
void |
processAuditLogging(javax.servlet.http.HttpServletRequest request)
Create log entries in the application's audit logs, containing all the key information about each request. |
protected org.apache.struts.action.ActionForward |
processException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Exception exception,
org.apache.struts.action.ActionForm form,
org.apache.struts.action.ActionMapping mapping)
Overrides the default processException method to ensure
all handled exceptions are logged in the application log file. |
protected boolean |
processPreprocess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Runs initializations and other necessary routines before every request. |
boolean |
sscOnPreRequestBegin(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs custom processing at the beginning of each call to processPreProcess . |
boolean |
sscOnPreRequestEnd(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs custom processing at the end of each call to processPreProcess . |
boolean |
sscOnPreRequestMiddle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs custom processing in the middle of each call to processPreProcess , directly after the
daoFactory has been initialized. |
Methods inherited from class org.apache.struts.tiles.TilesRequestProcessor |
---|
getDefinitionsFactory, init, initDefinitionsMapping, internalModuleRelativeForward, internalModuleRelativeInclude, processForwardConfig, processTilesDefinition, processTilesDefinition |
Methods inherited from class org.apache.struts.action.RequestProcessor |
---|
destroy, doInclude, getInternal, getServletContext, process, processActionCreate, processActionForm, processActionPerform, processCachedMessages, processContent, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processRoles, processValidate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.commons.logging.Log log
static org.apache.commons.logging.Log customerAuditLog
static org.apache.commons.logging.Log adminAuditLog
public static java.lang.String installerPath
/installer/Installer.do
.
public static java.lang.String errorPath
/installer/Installer.do
.
Constructor Detail |
---|
public BaseRequestProcessor()
Method Detail |
---|
protected boolean processPreprocess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Here are the steps this method takes for each request:
sscOnPreRequestBegin()
, which can be
overridden by a subclass to provide customizations.appSettings
or appComponents
objects do not exist in the application scope, initializes them.BusinessObjectFactory
does not exist in the request scope, initializes a new one. DAOFactory
does not
exist in the application scope, initializes a new one, including
initializing Hibernate.DAOFactory
to the
request's BusinessObjectFactory
.Settings
instance does not exist in the application scope, initializes a new one
in the application and request scope, and assigns it to the application's
DAOFactory
and the request's
BusinessObjectFactory
.User
does not exist in the session scope, or if the user's order has just
been placed or has been corrupted somehow, initializes a new one in the
session scope.User
to the request's
BusinessObjectFactory
.categoryTree
,
builtInCategories
or statesAndCountries
attributes do not exist in the application scope, initializes them using
ProductInitializer
and
OrderInitializer
.sscOnPreRequestEnd()
, which can be overridden
by a subclass to provide customizations.
processPreprocess
in class org.apache.struts.action.RequestProcessor
request
- The servlet request we are processing.response
- The servlet response we are creating.public boolean sscOnPreRequestBegin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
processPreProcess
. It is intended to be overridden by
subclasses for customizations. This method should return
false
to signal processPreProcess
to stop
futher processing and return false
itself.
true
if the processing was successful,
false
if processing in the request should stop.public boolean sscOnPreRequestMiddle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
processPreProcess
, directly after the
daoFactory
has been initialized. It is intended to be
overridden by subclasses for customizations. This method should return
false
to signal processPreProcess
to stop
futher processing and return false
itself.
true
if the processing was successful,
false
if processing in the request should stop.public boolean sscOnPreRequestEnd(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
processPreProcess
. This method should return
false
to signal processPreProcess
to return
false
itself.
true
if the processing was successful,
false
if processing should stop.protected org.apache.struts.action.ActionForward processException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception exception, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping) throws java.io.IOException, javax.servlet.ServletException
processException
method to ensure
all handled exceptions are logged in the application log file. There
should be no unhandled exceptions originating in a Struts action, unless
the struts-config.xml file is changed to eliminate the global exception
configuration for java.lang.Exception
. (It is also
possible for an exception to be thrown to the servlet container in this
method, if one happens in the course of the exception handling itself.)
processException
in class org.apache.struts.action.RequestProcessor
java.io.IOException
javax.servlet.ServletException
public java.lang.String getExceptionAsString(java.lang.Throwable exception)
protected void doForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
This method affects the forwards to the Tiles definitions for leftLayout,
centerLayout, and layout. The same process happens in
AppInsertTag
to handle
forwards coming from tiles insert tags.
doForward
in class org.apache.struts.tiles.TilesRequestProcessor
java.io.IOException
javax.servlet.ServletException
public java.lang.String getRequestParamsDebugMessage(javax.servlet.http.HttpServletRequest request)
request
- The current request object.
public void processAuditLogging(javax.servlet.http.HttpServletRequest request)
request
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |