Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.struts.action.RequestProcessor
public class RequestProcessor
extends java.lang.Object
Field Summary | |
static String |
|
static String |
|
protected HashMap |
|
protected ModuleConfig |
|
protected static Log |
|
protected ModuleConfig |
|
protected ActionServlet |
|
Method Summary | |
void |
|
protected void |
|
protected void |
|
int |
|
protected MessageResources |
|
protected ServletContext |
|
void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
void |
|
protected Action |
|
protected ActionForm |
|
protected void |
|
protected ActionForward |
|
protected void |
|
protected ActionForward |
|
protected boolean |
|
protected void |
|
protected boolean |
|
protected void |
|
protected ActionMapping |
|
protected HttpServletRequest |
|
protected void |
|
protected String |
|
protected void |
|
protected boolean |
|
protected boolean |
|
protected boolean |
|
public static final String INCLUDE_PATH_INFO
The request attribute under which the path information is stored for processing during a RequestDispatcher.include() call.
public static final String INCLUDE_SERVLET_PATH
The request attribute under which the servlet path information is stored for processing during a RequestDispatcher.include() call.
protected HashMap actions
The set of Action instances that have been created and initialized, keyed by the fully qualified Java class name of the Action class.
protected ModuleConfig appConfig
Deprecated. use moduleConfig instead.
The ModuleConfiguration we are associated with.
protected static Log log
Commons Logging instance.
public void destroy()
Clean up in preparation for a shutdown of this application.
protected void doForward(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Do a forward to specified uri using request dispatcher. This method is used by all internal method needing to do a forward.
- Parameters:
uri
- Context-relative URI to forward torequest
- Current page requestresponse
- Current page response
- Since:
- Struts 1.1
protected void doInclude(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Do an include of specified uri using request dispatcher. This method is used by all internal method needing to do an include
- Parameters:
uri
- Context-relative URI to includerequest
- Current page requestresponse
- Current page response
- Since:
- Struts 1.1
public int getDebug()
Deprecated. Configure the logging detail level in your underlying logging implementation
Return the debugging detail level that has been configured for our controller servlet.
protected MessageResources getInternal()
Return theMessageResources
instance containing our internal message strings.
protected ServletContext getServletContext()
Return the ServletContext for the web application we are running in.
public void init(ActionServlet servlet, ModuleConfig moduleConfig) throws ServletException
Initialize this request processor instance.
- Parameters:
servlet
- The ActionServlet we are associated withmoduleConfig
- The ModuleConfig we are associated with.
protected void internalModuleRelativeForward(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Do a module relative forward to specified uri using request dispatcher. Uri is relative to the current module. The real uri is compute by prefixing the module name. This method is used internally and is not part of the public API. It is advised to not use it in subclasses.
- Parameters:
uri
- Module-relative URI to forward torequest
- Current page requestresponse
- Current page response
- Since:
- Struts 1.1
protected void internalModuleRelativeInclude(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Do a module relative include to specified uri using request dispatcher. Uri is relative to the current module. The real uri is compute by prefixing the module name. This method is used internally and is not part of the public API. It is advised to not use it in subclasses.
- Parameters:
uri
- Module-relative URI to includerequest
- Current page requestresponse
- Current page response
- Since:
- Struts 1.1
protected void log(String message)
Log the specified message to the servlet context log for this web application.
- Parameters:
message
- The message to be logged
protected void log(String message, Throwable exception)
Log the specified message and exception to the servlet context log for this web application.
- Parameters:
message
- The message to be loggedexception
- The exception to be logged
public void process(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Process anHttpServletRequest
and create the correspondingHttpServletResponse
.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creating
protected Action processActionCreate(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) throws IOException
Return anAction
instance that will be used to process the current request, creating a new one if necessary.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The mapping we are using
protected ActionForm processActionForm(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
Retrieve and return theActionForm
bean associated with this mapping, creating and stashing one if necessary. If there is no form bean associated with this mapping, returnnull
.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The mapping we are using
protected void processActionForward(HttpServletRequest request, HttpServletResponse response, ActionForward forward) throws IOException, ServletException
Deprecated. Use processForwardConfig() instead.
Forward or redirect to the specified destination, by the specified mechanism. This method takes the old ActionForward object as parameter. User should useprocessForwardConfig(HttpServletRequest,HttpServletResponse,ForwardConfig)
when possible.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingforward
- The ActionForward controlling where we go next
protected ActionForward processActionPerform(HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, ServletException
Ask the specifiedAction
instance to handle this request. Return theActionForward
instance (if any) returned by the calledAction
for further processing.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingaction
- The Action instance to be usedform
- The ActionForm instance to pass to this Actionmapping
- The ActionMapping instance to pass to this Action
protected void processContent(HttpServletRequest request, HttpServletResponse response)
Set the default content type (with optional character encoding) for all responses if requested. NOTE - This header will be overridden automatically if aRequestDispatcher.forward()
call is ultimately invoked.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creating
protected ActionForward processException(HttpServletRequest request, HttpServletResponse response, Exception exception, ActionForm form, ActionMapping mapping) throws IOException, ServletException
Ask our exception handler to handle the exception. Return theActionForward
instance (if any) returned by the calledExceptionHandler
.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are processingexception
- The exception being handledform
- The ActionForm we are processingmapping
- The ActionMapping we are using
protected boolean processForward(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) throws IOException, ServletException
Process a forward requested by this mapping (if any). Returntrue
if standard processing should continue, orfalse
if we have already handled this request.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The ActionMapping we are using
protected void processForwardConfig(HttpServletRequest request, HttpServletResponse response, ForwardConfig forward) throws IOException, ServletException
Forward or redirect to the specified destination, by the specified mechanism. This method uses a ForwardConfig object instead an ActionForward.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingforward
- The ForwardConfig controlling where we go next
protected boolean processInclude(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) throws IOException, ServletException
Process an include requested by this mapping (if any). Returntrue
if standard processing should continue, orfalse
if we have already handled this request.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The ActionMapping we are using
protected void processLocale(HttpServletRequest request, HttpServletResponse response)
Automatically select a Locale for the current user, if requested. NOTE - configuring Locale selection will trigger the creation of a newHttpSession
if necessary.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creating
protected ActionMapping processMapping(HttpServletRequest request, HttpServletResponse response, String path) throws IOException
Select the mapping used to process the selection path for this request. If no mapping can be identified, create an error response and returnnull
.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingpath
- The portion of the request URI for selecting a mapping
protected HttpServletRequest processMultipart(HttpServletRequest request)
If this is a multipart request, wrap it with a special wrapper. Otherwise, return the request unchanged.
- Parameters:
request
- The HttpServletRequest we are processing
protected void processNoCache(HttpServletRequest request, HttpServletResponse response)
Set the no-cache headers for all responses, if requested. NOTE - This header will be overridden automatically if aRequestDispatcher.forward()
call is ultimately invoked.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creating
protected String processPath(HttpServletRequest request, HttpServletResponse response) throws IOException
Identify and return the path component (from the request URI) that we will use to select an ActionMapping to dispatch with. If no such path can be identified, create an error response and returnnull
.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creating
protected void processPopulate(HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping) throws ServletException
Populate the properties of the specified ActionForm instance from the request parameters included with this request. In addition, request attributeGlobals.CANCEL_KEY
will be set if the request was submitted with a button created byCancelTag
.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingform
- The ActionForm instance we are populatingmapping
- The ActionMapping we are using
protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response)
General-purpose preprocessing hook that can be overridden as required by subclasses. Returntrue
if you want standard processing to continue, orfalse
if the response has already been completed. The default implementation does nothing.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creating
protected boolean processRoles(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) throws IOException, ServletException
If this action is protected by security roles, make sure that the current user possesses at least one of them. Returntrue
to continue normal processing, orfalse
if an appropriate response has been created and processing should terminate.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The mapping we are using
protected boolean processValidate(HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping) throws IOException, ServletException
If this request was not cancelled, and the request'sActionMapping
has not disabled validation, call thevalidate()
method of the specifiedActionForm
, and forward back to the input form if there were any errors. Returntrue
if we should continue processing, orfalse
if we have already forwarded control back to the input form.
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creatingform
- The ActionForm instance we are populatingmapping
- The ActionMapping we are using