org.apache.beehive.netui.pageflow
Class PageFlowRequestProcessor

Object
  extended by RequestProcessor
      extended by TilesRequestProcessor
          extended by PageFlowRequestProcessor
All Implemented Interfaces:
Serializable, InternalConstants, PageFlowConstants

public class PageFlowRequestProcessor
extends TilesRequestProcessor
implements Serializable, InternalConstants, PageFlowConstants

The Page Flow extension of the Struts RequestProcessor, which contains callbacks that are invoked during processing of a request to the Struts action servlet. This class is registered as the controller for all Struts modules derived from page flows.

See Also:
Serialized Form

Nested Class Summary
static class PageFlowRequestProcessor.ExceptionHandledAction
          Used by processMapping(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String).
protected static class PageFlowRequestProcessor.ExceptionHandledActionMapping
          Used by processMapping(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String).
 
Field Summary
 
Fields inherited from class TilesRequestProcessor
definitionsFactory, log
 
Fields inherited from class RequestProcessor
actions, appConfig, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
 
Fields inherited from interface InternalConstants
ACTION_EXTENSION_LEN, ACTION_OVERRIDE_PREFIX, ANNOTATION_QUALIFIER, ATTR_PREFIX, BACKING_CLASS_IMPLICIT_OBJECT, BEGIN_ACTION_PATH, CURRENT_JPF_ATTR, CURRENT_LONGLIVED_ATTR, FACES_BACKING_ATTR, FACES_BACKING_EXTENSION, FACES_EXTENSION, FACES_EXTENSION_DOT, GLOBALAPP_CLASSNAME, GLOBALAPP_MEMBER_NAME, GLOBALAPP_MODULE_CONTEXT_PATH, INTERNAL_VAR_PREFIX, JSF_EXTENSION, JSF_EXTENSION_DOT, MESSAGE_IS_EXPRESSION_PREFIX, MESSAGE_IS_EXPRESSION_PREFIX_LENGTH, NETUI_CONFIG_PATH, RETURN_ACTION_VIEW_RENDERER_PARAM, RETURNING_FORM_ATTR, RETURNING_FROM_NESTING_ATTR, SHARED_FLOW_ATTR_PREFIX, SHARED_FLOW_EXTENSION, SHARED_FLOW_MODULE_PREFIX, SHARED_FLOW_MODULE_PREFIX_LEN, SHARED_FLOW_ROOT_MODULE, WEBINF_DIR
 
Fields inherited from interface PageFlowConstants
ACTION_EXTENSION, ACTION_OVERRIDE, AUTO_VIEW_RENDER_FORWARD_NAME, BEGIN_ACTION_NAME, DEFAULT_FORWARD_OVERFLOW_COUNT, DEFAULT_NESTING_OVERFLOW_COUNT, FORWARD_OVERFLOW_COUNT_PARAM, GLOBALAPP_CLASSNAME, GLOBALAPP_SOURCEFILE_NAME, JPF_EXTENSION, JPF_MODULE_CONFIG_EXTENSION, JPF_MODULE_CONFIG_GEN_DIR, JPF_MODULE_CONFIG_PREFIX, NESTING_OVERFLOW_COUNT_PARAM, PAGEFLOW_EXTENSION, PAGEFLOW_MODULE_CONFIG_EXTENSION, PAGEFLOW_MODULE_CONFIG_GEN_DIR, PAGEFLOW_MODULE_CONFIG_PREFIX, SECURE_FORWARDS_PARAM
 
Constructor Summary
PageFlowRequestProcessor()
           
 
Method Summary
protected  boolean changeScheme(String webappRelativeURI, String scheme, int port, FlowControllerHandlerContext context)
           
protected  void doForward(String uri, HttpServletRequest request, HttpServletResponse response)
           
protected  ActionMapping getBeginMapping()
           
 void init(ActionServlet actionServlet, ModuleConfig mc)
           
protected  void initDefinitionsMapping()
          Read component instance mapping configuration file.
 void process(HttpServletRequest request, HttpServletResponse response)
           
protected  Action processActionCreate(HttpServletRequest request, HttpServletResponse response, ActionMapping actionMapping)
           
protected  ActionForm processActionForm(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
           
protected  boolean processActionOverride(HttpServletRequest request, HttpServletResponse response)
          The requested action can be overridden by a request parameter.
protected  ActionForward processActionPerform(HttpServletRequest request, HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping)
           
 ActionForward processException(HttpServletRequest request, HttpServletResponse response, Exception ex, ActionForm form, ActionMapping mapping)
           
protected  void processForwardConfig(HttpServletRequest request, HttpServletResponse response, ForwardConfig fwd)
          This override of the base method ensures that absolute URIs don't get the context path prepended, and handles forwards to special things like return-to="currentPage".
 ActionMapping processMapping(HttpServletRequest request, HttpServletResponse response, String path)
           
protected  HttpServletRequest processMultipart(HttpServletRequest request)
          If this is a multipart request, wrap it with a special wrapper.
protected  void processNoCache(HttpServletRequest request, HttpServletResponse response)
          Set the no-cache headers.
protected  boolean processPageFlowRequest(HttpServletRequest request, HttpServletResponse response, String uri)
          Process any direct request for a page flow by forwarding to its "begin" action.
protected  void processPopulate(HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping)
           
protected  boolean processRoles(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
           
protected  boolean processSharedFlowMapping(HttpServletRequest request, HttpServletResponse response, String actionPath, FlowController currentFlowController)
           
protected  ActionMapping processUnresolvedAction(String actionPath, HttpServletRequest request, HttpServletResponse response, Object returningForm)
           
protected  boolean processValidate(HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping)
           
protected  boolean shouldDoSecureForwards()
          Deprecated. Use LegacySettings.shouldDoSecureForwards() instead.
 
Methods inherited from class TilesRequestProcessor
getDefinitionsFactory, internalModuleRelativeForward, internalModuleRelativeInclude, processTilesDefinition
 
Methods inherited from class RequestProcessor
destroy, doInclude, getDebug, getInternal, getServletContext, log, log, processActionForward, processContent, processForward, processInclude, processLocale, processPath, processPreprocess
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageFlowRequestProcessor

public PageFlowRequestProcessor()
Method Detail

processActionCreate

protected Action processActionCreate(HttpServletRequest request,
                                     HttpServletResponse response,
                                     ActionMapping actionMapping)
                              throws IOException
Overrides:
processActionCreate in class RequestProcessor
Throws:
IOException

processActionForm

protected ActionForm processActionForm(HttpServletRequest request,
                                       HttpServletResponse response,
                                       ActionMapping mapping)
Overrides:
processActionForm in class RequestProcessor

processPopulate

protected void processPopulate(HttpServletRequest request,
                               HttpServletResponse response,
                               ActionForm form,
                               ActionMapping mapping)
                        throws ServletException
Overrides:
processPopulate in class RequestProcessor
Throws:
ServletException

processActionOverride

protected boolean processActionOverride(HttpServletRequest request,
                                        HttpServletResponse response)
                                 throws IOException,
                                        ServletException
The requested action can be overridden by a request parameter. In this case, we parse the action from the request parameter and forward to a URI constructed from it.

Parameters:
request - the current HttpServletRequest
response - the current HttpServletResponse
Returns:
true if the action was overridden by a request parameter, in which case the request was forwarded.
Throws:
IOException
ServletException

processPageFlowRequest

protected boolean processPageFlowRequest(HttpServletRequest request,
                                         HttpServletResponse response,
                                         String uri)
                                  throws IOException,
                                         ServletException
Process any direct request for a page flow by forwarding to its "begin" action.

Parameters:
request - the current HttpServletRequest
response - the current HttpServletResponse
uri - the decoded request URI
Returns:
true if the request was for a page flow, in which case it was forwarded.
Throws:
IOException
ServletException

process

public void process(HttpServletRequest request,
                    HttpServletResponse response)
             throws IOException,
                    ServletException
Overrides:
process in class RequestProcessor
Throws:
IOException
ServletException

processMultipart

protected HttpServletRequest processMultipart(HttpServletRequest request)
If this is a multipart request, wrap it with a special wrapper. Otherwise, return the request unchanged.

Overrides:
processMultipart in class RequestProcessor
Parameters:
request - The HttpServletRequest we are processing

getBeginMapping

protected ActionMapping getBeginMapping()

processException

public ActionForward processException(HttpServletRequest request,
                                      HttpServletResponse response,
                                      Exception ex,
                                      ActionForm form,
                                      ActionMapping mapping)
                               throws IOException,
                                      ServletException
Overrides:
processException in class RequestProcessor
Throws:
IOException
ServletException

init

public void init(ActionServlet actionServlet,
                 ModuleConfig mc)
          throws ServletException
Overrides:
init in class TilesRequestProcessor
Throws:
ServletException

initDefinitionsMapping

protected void initDefinitionsMapping()
                               throws ServletException
Read component instance mapping configuration file. This is where we read files properties.

Overrides:
initDefinitionsMapping in class TilesRequestProcessor
Throws:
ServletException

processMapping

public ActionMapping processMapping(HttpServletRequest request,
                                    HttpServletResponse response,
                                    String path)
                             throws IOException
Overrides:
processMapping in class RequestProcessor
Throws:
IOException

processSharedFlowMapping

protected boolean processSharedFlowMapping(HttpServletRequest request,
                                           HttpServletResponse response,
                                           String actionPath,
                                           FlowController currentFlowController)
                                    throws IOException
Throws:
IOException

processUnresolvedAction

protected ActionMapping processUnresolvedAction(String actionPath,
                                                HttpServletRequest request,
                                                HttpServletResponse response,
                                                Object returningForm)
                                         throws IOException
Throws:
IOException

processRoles

protected boolean processRoles(HttpServletRequest request,
                               HttpServletResponse response,
                               ActionMapping mapping)
                        throws IOException,
                               ServletException
Overrides:
processRoles in class RequestProcessor
Throws:
IOException
ServletException

processForwardConfig

protected void processForwardConfig(HttpServletRequest request,
                                    HttpServletResponse response,
                                    ForwardConfig fwd)
                             throws IOException,
                                    ServletException
This override of the base method ensures that absolute URIs don't get the context path prepended, and handles forwards to special things like return-to="currentPage".

Overrides:
processForwardConfig in class TilesRequestProcessor
Throws:
IOException
ServletException

changeScheme

protected boolean changeScheme(String webappRelativeURI,
                               String scheme,
                               int port,
                               FlowControllerHandlerContext context)
                        throws URISyntaxException,
                               IOException,
                               ServletException
Throws:
URISyntaxException
IOException
ServletException

shouldDoSecureForwards

protected boolean shouldDoSecureForwards()
Deprecated. Use LegacySettings.shouldDoSecureForwards() instead.


doForward

protected void doForward(String uri,
                         HttpServletRequest request,
                         HttpServletResponse response)
                  throws IOException,
                         ServletException
Overrides:
doForward in class TilesRequestProcessor
Throws:
IOException
ServletException

processNoCache

protected void processNoCache(HttpServletRequest request,
                              HttpServletResponse response)
Set the no-cache headers. This overrides the base Struts behavior to prevent caching even for the pages.

Overrides:
processNoCache in class RequestProcessor

processActionPerform

protected ActionForward processActionPerform(HttpServletRequest request,
                                             HttpServletResponse response,
                                             Action action,
                                             ActionForm form,
                                             ActionMapping mapping)
                                      throws IOException,
                                             ServletException
Overrides:
processActionPerform in class RequestProcessor
Throws:
IOException
ServletException

processValidate

protected boolean processValidate(HttpServletRequest request,
                                  HttpServletResponse response,
                                  ActionForm form,
                                  ActionMapping mapping)
                           throws IOException,
                                  ServletException
Overrides:
processValidate in class RequestProcessor
Throws:
IOException
ServletException