Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.struts.faces.application
Class FacesTilesRequestProcessor  view FacesTilesRequestProcessor download FacesTilesRequestProcessor.java

java.lang.Object
  extended byorg.apache.struts.action.RequestProcessor
      extended byorg.apache.struts.tiles.TilesRequestProcessor
          extended byorg.apache.struts.faces.application.FacesTilesRequestProcessor

public class FacesTilesRequestProcessor
extends org.apache.struts.tiles.TilesRequestProcessor

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+Tiles, so it must support non-Faces requests as well.

Version:
$Rev: 56770 $ $Date: 2004-11-06 18:15:35 +0000 (Sat, 06 Nov 2004) $

Field Summary
protected static org.apache.commons.logging.Log log
          The log instance for this class.
 
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
FacesTilesRequestProcessor()
           
 
Method Summary
protected  void doForward(java.lang.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  void internalModuleRelativeForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Catch the call to a module relative forward.
private  boolean isStrutsRequest(java.lang.String uri)
          Return true if the specified context-relative URI specifies a request to be processed by the Struts controller servlet.
protected  org.apache.struts.action.Action processActionCreate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
          Return an Action instance that will be used to process the current request, creating a new one if necessary.
protected  org.apache.struts.action.ActionForm processActionForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
          Retrieve and return the ActionForm associated with this mapping, creating and retaining one if necessary.
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)
          Ask the specified Action instance to handle this request.
protected  boolean processForward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
          Process a forward requested by this mapping (if any).
protected  void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.config.ForwardConfig forward)
          Overloaded method from Struts' RequestProcessor.
protected  boolean processInclude(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
          Process an include requested by this mapping (if any).
protected  java.lang.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, org.apache.struts.action.ActionForm form, org.apache.struts.action.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, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
          If this request was not cancelled, and the request's org.apache.struts.action.ActionMapping has not disabled validation, call the validate method of the specified org.apache.struts.action.ActionForm, and forward to the input path if there were any errors.
 
Methods inherited from class org.apache.struts.tiles.TilesRequestProcessor
getDefinitionsFactory, init, initDefinitionsMapping, internalModuleRelativeInclude, processTilesDefinition
 
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doInclude, getInternal, getServletContext, log, log, process, processCachedMessages, processContent, processException, processLocale, processMapping, processMultipart, processNoCache, processPreprocess, processRoles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

The log instance for this class.

Constructor Detail

FacesTilesRequestProcessor

public FacesTilesRequestProcessor()
Method Detail

doForward

protected void doForward(java.lang.String uri,
                         javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.io.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.


internalModuleRelativeForward

protected void internalModuleRelativeForward(java.lang.String uri,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
                                      throws java.io.IOException,
                                             javax.servlet.ServletException
Description copied from class: org.apache.struts.tiles.TilesRequestProcessor
Catch the call to a module relative forward. If the specified uri is a tiles definition name, insert it. Otherwise, parent processing is called. Do a module relative forward to specified uri using request dispatcher. Uri is relative to the current module. The real uri is computed 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.


processActionCreate

protected org.apache.struts.action.Action processActionCreate(javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response,
                                                              org.apache.struts.action.ActionMapping mapping)
                                                       throws java.io.IOException
Description copied from class: org.apache.struts.action.RequestProcessor

Return an Action instance that will be used to process the current request, creating a new one if necessary.


processActionForm

protected org.apache.struts.action.ActionForm processActionForm(javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response,
                                                                org.apache.struts.action.ActionMapping mapping)
Description copied from class: org.apache.struts.action.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.


processActionPerform

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
Description copied from class: org.apache.struts.action.RequestProcessor

Ask the specified Action instance to handle this request. Return the ActionForward instance (if any) returned by the called Action for further processing.


processForward

protected boolean processForward(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 org.apache.struts.action.ActionMapping mapping)
                          throws java.io.IOException,
                                 javax.servlet.ServletException
Description copied from class: org.apache.struts.action.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.


processForwardConfig

protected void processForwardConfig(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    org.apache.struts.config.ForwardConfig forward)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
Description copied from class: org.apache.struts.tiles.TilesRequestProcessor
Overloaded method from Struts' RequestProcessor. Forward or redirect to the specified destination by the specified mechanism. This method catches the Struts' actionForward call. It checks if the actionForward is done on a Tiles definition name. If true, process the definition and insert it. If false, call the original parent's method.


processInclude

protected boolean processInclude(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 org.apache.struts.action.ActionMapping mapping)
                          throws java.io.IOException,
                                 javax.servlet.ServletException
Description copied from class: org.apache.struts.action.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.


processPath

protected java.lang.String processPath(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response)
                                throws java.io.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.


processPopulate

protected void processPopulate(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               org.apache.struts.action.ActionForm form,
                               org.apache.struts.action.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.


processValidate

protected boolean processValidate(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  org.apache.struts.action.ActionForm form,
                                  org.apache.struts.action.ActionMapping mapping)
                           throws java.io.IOException,
                                  javax.servlet.ServletException
Description copied from class: org.apache.struts.action.RequestProcessor

If this request was not cancelled, and the request's org.apache.struts.action.ActionMapping has not disabled validation, call the validate method of the specified org.apache.struts.action.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.


isStrutsRequest

private boolean isStrutsRequest(java.lang.String uri)

Return true if the specified context-relative URI specifies a request to be processed by the Struts controller servlet.