|
||||||||||
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
Subclass of TilesRequestProcessor
that negotiates each
application request.
Field Summary | |
static java.lang.String |
errorPath
Path to forward the request to if an error occurs when connecting to the database. |
static java.lang.String |
installerSettingsLocation
The location on the classpath of the properties file that the installer uses to configure the application. |
(package private) static org.apache.commons.logging.Log |
log
|
static java.lang.String |
systemLayoutDirectory
The name of the directory under the "WEB-INF/layouts" directory in the application distribution where the system's default jsp templates reside. |
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 java.lang.String |
alterURI(java.lang.String uri,
java.lang.String layout)
Replaces strings matching the system layout directory with the user's custom layout directory. |
protected void |
doForward(java.lang.String uri,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Override the regular forward to use the user's custom layout, if any. |
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. |
boolean |
npcOnPreRequestBegin(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs custom processing at the beginning of each call to processPreProcess . |
boolean |
npcOnPreRequestEnd(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs custom processing at the end of each call to processPreProcess . |
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 into the system. |
Methods inherited from class org.apache.struts.tiles.TilesRequestProcessor |
getDefinitionsFactory, init, initDefinitionsMapping, internalModuleRelativeForward, internalModuleRelativeInclude, processForwardConfig, processTilesDefinition |
Methods inherited from class org.apache.struts.action.RequestProcessor |
destroy, doInclude, getInternal, getServletContext, log, log, 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
public static final java.lang.String installerSettingsLocation
appSettings.properties
, meaning the installer will look
for a file named appSettings.properties
under the
classes
directory of the application.
public static final java.lang.String errorPath
/installer/Error.do
.
public static final java.lang.String systemLayoutDirectory
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:
npcOnPreRequestBegin()
, which can be
overridden by a subclass to provide customizations.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
creating a connection pool or utilizing a JNDI connection pool.DAOFactory
to the
request's BusinessObjectFactory
.SettingsBean
does not exist in the request scope, initializes a new one.SettingsBean
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
request
- The servlet request we are processing.response
- The servlet response we are creating.public boolean npcOnPreRequestBegin(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 npcOnPreRequestEnd(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 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.)
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 same process happens in
AppInsertTag
to
handle forwards coming from tiles insert tags.
java.io.IOException
javax.servlet.ServletException
protected java.lang.String alterURI(java.lang.String uri, java.lang.String layout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |