|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.action.RequestProcessor com.boylesoftware.cb2.presentation.servlet.CB2RequestProcessor
CB2 Struts request processor. This processor is automatically set up
for a module by the CB2PlugIn
. You application can extend
this class to provide additional request processing logic. If you
subclass this class you will have to specify the your class name to
the CB2PlugIn
by setting its controller
property (or, as an alternative, by providing processorClass
attribute to the controller
element in the Struts
configuration file).
This class logs messages under "com.boylesoftware.cb2.CTRLER" log channel.
Field Summary |
Fields inherited from class org.apache.struts.action.RequestProcessor |
actions, appConfig, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, servlet |
Constructor Summary | |
CB2RequestProcessor()
|
Method Summary | |
void |
destroy()
Gracefully shutdown the application. |
void |
init(org.apache.struts.action.ActionServlet actionServlet,
org.apache.struts.config.ModuleConfig moduleConfig)
Initializes the request processor. |
void |
process(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process a request. |
protected org.apache.struts.action.ActionForward |
processActionPerform(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.apache.struts.action.Action action,
org.apache.struts.action.ActionForm form,
org.apache.struts.action.ActionMapping mapping)
Overrides the basic Struts method that calls actions. |
protected void |
processForwardConfig(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.apache.struts.config.ForwardConfig forward)
Forward to the specified destination by the specified mechanism if an ActionForward instance was returned by the
Action . |
protected org.apache.struts.config.ForwardConfig |
processPostprocess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.apache.struts.config.ForwardConfig forward)
Performs request post-processing after the action has been executed and returned a forward. |
Methods inherited from class org.apache.struts.action.RequestProcessor |
doForward, doInclude, getDebug, getInternal, getServletContext, internalModuleRelativeForward, internalModuleRelativeInclude, log, log, processActionCreate, processActionForm, processActionForward, processContent, processException, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles, processValidate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CB2RequestProcessor()
Method Detail |
public void init(org.apache.struts.action.ActionServlet actionServlet, org.apache.struts.config.ModuleConfig moduleConfig) throws javax.servlet.ServletException
javax.servlet.ServletException
- if an error occurs during the initialization.public void destroy()
ControllerServlet
, which
usually happens when the web-application goes down.
public void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
request
- the HTTP request to be processed.response
- the HTTP response to be sent back to the
client.
javax.servlet.ServletException
- indicates a serious error in the
application.
java.io.IOException
- if an I/O error occurs.protected org.apache.struts.action.ActionForward processActionPerform(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.Action action, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping) throws java.io.IOException, javax.servlet.ServletException
pages-config.xml
and if so calls the appropriate preactions
first.
request
- request we are processing.response
- response we are creating.action
- action to be called.form
- form to pass to the action.mapping
- action mapping to pass to the action.
java.io.IOException
- if I/O error occurs.
javax.servlet.ServletException
- if other error occurs.protected org.apache.struts.config.ForwardConfig processPostprocess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.config.ForwardConfig forward) throws javax.servlet.ServletException, java.io.IOException
processForwardConfig
and adds
additional functionality, such as special tokens in the
forward's path
attribute.
In the path
attribute of a forward
element of your action mapping you can specify special lexical
tokens, which are recognized by this method and replaced by
some values, depending on the token, before the path is passed
further to Struts. Currently CB2 recognizes the following
tokens:
[request:xxx]
- will be substituted by the
value of request parameter named xxx
. If there is
no such parameter in the request, then the method will try to
get it from the request's attributes. If it is still not found
an empty string will be put in place of the token.
[rqparam:xxx]
- will be substituted by the
value of request parameter named xxx
. If there is
no such parameter in the request an empty string will be put in
place of the token.
[rqattribute:xxx]
- will be substituted by the
string value of request attribute named xxx
. If
there is no such attribute in the request an empty string will
be put in place of the token.
[session:xxx]
- will be substituted by the
string value of session attribute named xxx
. If
there is no such attribute in the session an empty string will
be put in place of the token.
[any:xxx]
- will be substituted by the value
looked up by the name xxx
first among the request
parameters, if not found, then in the request attribtues, and
if still not found, in the session. If the value cannot be
found in any of these sources an empty string will be put in
place of the token.
Also, this method actually performs the logout operations if the action asked for it.
request
- request we are processing.response
- response we are creating.forward
- forward controlling where we go next.
java.io.IOException
- if I/O error occurs.
javax.servlet.ServletException
- if other error occurs.protected void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.config.ForwardConfig forward) throws javax.servlet.ServletException, java.io.IOException
ActionForward
instance was returned by the
Action
. This method overrides the original one from
Struts and adds processPostprocess
method call.
request
- request we are processing.response
- response we are creating.forward
- forward controlling where we go next.
java.io.IOException
- if I/O error occurs.
javax.servlet.ServletException
- if other error occurs.processPostprocess(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.config.ForwardConfig)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |