|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.action.RequestProcessor
org.springframework.web.struts.DelegatingRequestProcessor
jp.terasoluna.fw.web.struts.action.RequestProcessorEx
public class RequestProcessorEx
Class extended from DelegatingRequestProcessor.
Receives the request from the client and invokes the action according to the URI. Following functions are added by inheriting org.springframework.web.struts.DelegatingRequestProcessor.
When the logical name of action form in the session scope, starts with "_", all the other action forms which are stored in the session and which starts with the logical name as "_", are deleted at the time of creating the instance. This ensures that at the maximum only one action form is generated in the session and the memory can be utilized without any problem even if the source for the deletion process of action form under the session scope, is not written.
<struts-config>
<form-beans>
<!-- Attach "_" at the beginning of the form -->
<form-bean name="_sampleForm"
type="jp.terasoluna.fw.web.struts.form.DynaValidatorActionFormEx"
>
<form-property name="companyId" type="java.lang.String" />
...
</struts-config>
Skip processPopulate() when form is not switched from the action form in which business logic execution result is reflected.
When there is input check error, store the action error in the action form to display the error on the pop up screen. When the error does not occur, set the empty action error in the action form.
When the exception is thrown in the RequestProcessor#process(), output the exception stack trace to the log. After the log is output, exception is wrapped by the ServletException and is thrown.
To use RequestProcessorEx, it is necessary to perform the settings in the processorClass attribute of the <controller> element in struts-config.xml.
<struts-config>
...
<controller processorClass=
"jp.terasoluna.fw.web.struts.RequestProcessorEx"/>
...
</struts-config>
For the details of feature that inhibits the mapping values in Form, refer to the ActionEx.
ActionEx
,
FormEx
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
log
Log class. |
static java.lang.String |
SKIP_POPULATE
Key when the flag which skips the processPopulate() is set in the request. |
Fields inherited from class org.apache.struts.action.RequestProcessor |
---|
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet |
Constructor Summary | |
---|---|
RequestProcessorEx()
|
Method Summary | |
---|---|
void |
process(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Extends the HTTP request process of Struts. |
protected org.apache.struts.action.ActionForm |
processActionForm(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
org.apache.struts.action.ActionMapping mapping)
Extends the action form fetching process of Struts. |
protected org.apache.struts.action.ActionForm |
processActionFormEx(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
ActionMappingEx mapping)
Extends the action form fetching process of Struts. It is invoked from processActionForm(). |
protected void |
processPopulate(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
org.apache.struts.action.ActionForm form,
org.apache.struts.action.ActionMapping mapping)
Extends request parameter mapping process of the Struts action form. |
Methods inherited from class org.springframework.web.struts.DelegatingRequestProcessor |
---|
determineActionBeanName, getDelegateAction, getWebApplicationContext, init, initWebApplicationContext, processActionCreate |
Methods inherited from class org.apache.struts.action.RequestProcessor |
---|
destroy, doForward, doInclude, getInternal, getServletContext, internalModuleRelativeForward, internalModuleRelativeInclude, log, log, processActionPerform, processCachedMessages, processContent, processException, processForward, processForwardConfig, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPreprocess, processRoles, processValidate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static org.apache.commons.logging.Log log
public static final java.lang.String SKIP_POPULATE
Constructor Detail |
---|
public RequestProcessorEx()
Method Detail |
---|
public void process(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletException
This method catches the SystemException as well as the exception which is thrown by the process() method of ActionServlet in Struts. After the log is output, exception details and hash value of session ID are wrapped by the ServletException and are thrown.
process
in class org.apache.struts.action.RequestProcessor
req
- HTTP requestres
- HTTP response
java.io.IOException
- IO exception
javax.servlet.ServletException
- Servlet exceptionprotected org.apache.struts.action.ActionForm processActionForm(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.apache.struts.action.ActionMapping mapping)
Action forms specified in the action mapping and starting with the "_" are transferred to the processActionFormEx() for processing.
processActionForm
in class org.apache.struts.action.RequestProcessor
req
- HTTP requestres
- HTTP responsemapping
- Action mapping
protected org.apache.struts.action.ActionForm processActionFormEx(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, ActionMappingEx mapping)
Processes action forms which are specified in action mapping and starting with "_".
After performing the action form process, invokes processPopulate() method of RequestProcessor.
req
- HTTP requestres
- HTTP responsemapping
- Action mapping
protected void processPopulate(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping) throws javax.servlet.ServletException
It invokes processPopulate() method of RequestProcessor when the form is switched from the action form in which business logic execution result is reflected, .
When the cancelPopulate is set to true in the action mapping settings of struts-config.xml, processPopulate is cancelled.
processPopulate
in class org.apache.struts.action.RequestProcessor
req
- HTTP requestres
- HTTP responseform
- Action formmapping
- Action mapping
javax.servlet.ServletException
- Servlet exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |