public class FacesRequestProcessor extends RequestProcessor
Concrete implementation of RequestProcessor
that
implements the standard Struts request processing lifecycle on a
request that was received as an ActionEvent
by our
associated ActionListener
. It replaces the request processor
instance normally configured by Struts, so it must support non-Faces
requests as well.
Modifier and Type | Field and Description |
---|---|
static String |
LIFECYCLE_ID_ATTR
The lifecycle id.
|
protected static org.apache.commons.logging.Log |
log
The log instance for this class.
|
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
Constructor and Description |
---|
FacesRequestProcessor() |
Modifier and Type | Method and Description |
---|---|
protected void |
doForward(String uri,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Set up a Faces Request if we are not already processing one.
|
protected Action |
processActionCreate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ActionMapping mapping)
Return an
Action instance that will be used to process
the current request, creating a new one if necessary. |
protected ActionForm |
processActionForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ActionMapping mapping)
Retrieve and return the
ActionForm associated with this
mapping, creating and retaining one if necessary. |
protected ActionForward |
processActionPerform(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Action action,
ActionForm form,
ActionMapping mapping)
Ask the specified
Action instance to handle this
request. |
protected boolean |
processForward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ActionMapping mapping)
Process a forward requested by this mapping (if any).
|
protected void |
processForwardConfig(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ForwardConfig forward)
Forward or redirect to the specified destination, by the specified
mechanism.
|
protected boolean |
processInclude(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ActionMapping mapping)
Process an include requested by this mapping (if any).
|
protected String |
processPath(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Identify and return the path component (from the request URI for a
non-Faces request, or from the form event for a Faces request)
that we will use to select an ActionMapping to dispatch with.
|
protected void |
processPopulate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ActionForm form,
ActionMapping mapping)
Populate the properties of the specified
ActionForm
instance from the request parameters included with this request,
IF this is a non-Faces request. |
protected boolean |
processValidate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ActionForm form,
ActionMapping mapping)
If this request was not cancelled, and the request's
ActionMapping has not disabled validation, call the
validate method of the specified ActionForm , and
forward to the input path if there were any errors. |
destroy, doInclude, getInternal, getServletContext, init, internalModuleRelativeForward, internalModuleRelativeInclude, process, processCachedMessages, processContent, processException, processLocale, processMapping, processMultipart, processNoCache, processPreprocess, processRoles
protected static org.apache.commons.logging.Log log
The log instance for this class.
public static final String LIFECYCLE_ID_ATTR
The lifecycle id.
protected void doForward(String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
Set up a Faces Request if we are not already processing one. Next,
create a new view if the specified uri
is different from
the current view identifier. Finally, cause the new view to be
rendered, and call FacesContext.responseComplete()
to
indicate that this has already been done.
doForward
in class RequestProcessor
uri
- Context-relative path to forward torequest
- Current page requestresponse
- Current page responseIOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet error occursprotected Action processActionCreate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping) throws IOException
RequestProcessor
Return an Action
instance that will be used to process
the current request, creating a new one if necessary.
processActionCreate
in class RequestProcessor
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The mapping we are usingAction
instance that will be used to process
the current request.IOException
- if an input/output error occursprotected ActionForm processActionForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping)
RequestProcessor
Retrieve and return the ActionForm
associated with this
mapping, creating and retaining one if necessary. If there is no
ActionForm
associated with this mapping, return
null
.
processActionForm
in class RequestProcessor
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The mapping we are usingActionForm
associated with this mapping.protected ActionForward processActionPerform(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping) throws IOException, javax.servlet.ServletException
RequestProcessor
Ask the specified Action
instance to handle this
request. Return the ActionForward
instance (if any)
returned by the called Action
for further processing.
processActionPerform
in class RequestProcessor
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 ActionActionForward
instance (if any) returned by
the called Action
.IOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet exception occursprotected boolean processForward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping) throws IOException, javax.servlet.ServletException
RequestProcessor
Process a forward requested by this mapping (if any). Return
true
if standard processing should continue, or
false
if we have already handled this request.
processForward
in class RequestProcessor
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The ActionMapping we are usingtrue
to continue normal processing;
false
if a response has been created.IOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet exception occursprotected void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ForwardConfig forward) throws IOException, javax.servlet.ServletException
RequestProcessor
Forward or redirect to the specified destination, by the specified
mechanism. This method uses a ForwardConfig
object
instead an ActionForward
.
processForwardConfig
in class RequestProcessor
request
- The servlet request we are processingresponse
- The servlet response we are creatingforward
- The ForwardConfig controlling where we go nextIOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet exception occursprotected boolean processInclude(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping) throws IOException, javax.servlet.ServletException
RequestProcessor
Process an include requested by this mapping (if any). Return
true
if standard processing should continue, or
false
if we have already handled this request.
processInclude
in class RequestProcessor
request
- The servlet request we are processingresponse
- The servlet response we are creatingmapping
- The ActionMapping we are usingtrue
to continue normal processing;
false
if a response has been created.IOException
- if an input/output error occursjavax.servlet.ServletException
- if thrown by invoked methodsprotected String processPath(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Identify and return the path component (from the request URI for a
non-Faces request, or from the form event for a Faces request)
that we will use to select an ActionMapping to dispatch with.
If no such path can be identified, create an error response and return
null
.
processPath
in class RequestProcessor
request
- The servlet request we are processingresponse
- The servlet response we are creatingIOException
- if an input/output error occursprotected void processPopulate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionForm form, ActionMapping mapping) throws javax.servlet.ServletException
Populate the properties of the specified ActionForm
instance from the request parameters included with this request,
IF this is a non-Faces request. For a Faces request,
this will have already been done by the Update Model Values
phase of the request processing lifecycle, so all we have to do is
recognize whether the request was cancelled or not.
processPopulate
in class RequestProcessor
request
- The servlet request we are processingresponse
- The servlet response we are creatingform
- The ActionForm instance we are populatingmapping
- The ActionMapping we are usingjavax.servlet.ServletException
- if thrown by RequestUtils.populate()protected boolean processValidate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionForm form, ActionMapping mapping) throws IOException, javax.servlet.ServletException, InvalidCancelException
RequestProcessor
If this request was not cancelled, and the request's ActionMapping
has not disabled validation, call the
validate
method of the specified ActionForm
, and
forward to the input path if there were any errors. Return
true
if we should continue processing, or
false
if we have already forwarded control back to the
input form.
processValidate
in class RequestProcessor
request
- The servlet request we are processingresponse
- The servlet response we are creatingform
- The ActionForm instance we are populatingmapping
- The ActionMapping we are usingtrue
to continue normal processing;
false
if a response has been created.IOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet exception occursInvalidCancelException
- if a cancellation is attempted
without the proper action configuration.Copyright © 2000–2016 Apache Software Foundation. All rights reserved.