Expresso 5-6

com.jcorporate.expresso.core.controller
Class ExpressoRequestProcessor

java.lang.Object
  extended byorg.apache.struts.action.RequestProcessor
      extended byorg.apache.struts.tiles.TilesRequestProcessor
          extended bycom.jcorporate.expresso.core.controller.ExpressoRequestProcessor

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

Title: Expresso Project Description: Copyright: Copyright (c) 2001, 2002, 2003 Company: Jcorporate

Version:
$Id: ExpressoRequestProcessor.java,v 1.10 2004/11/17 20:48:06 lhamel Exp $
Author:
Peter Pilgrim, Wed Feb 12 20:13:46 GMT 2003

Field Summary
protected static org.apache.commons.logging.Log log
          Commons Logging instance.
 
Fields inherited from class org.apache.struts.tiles.TilesRequestProcessor
definitionsFactory
 
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, appConfig, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
 
Constructor Summary
ExpressoRequestProcessor()
          Default constructor
 
Method Summary
 org.apache.struts.action.Action createAction(String className)
          Creates and return the Action controller.
 void init(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig moduleConfig)
          Initialize this request processor instance.
protected  void processForwardConfig(HttpServletRequest request, HttpServletResponse response, org.apache.struts.config.ForwardConfig forward)
          This method was created specifically to allow dynamic URL forwarding since we cannot muck with the Struts 1.1 configuration due to the 'freeze()' method.
protected  String processPath(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
          subclass in order to allow ExpressoActionServlet to be a dispatcher for any finite-state-machine request which includes parameters for controller & state.
 boolean processPrepocess(HttpServletRequest request, HttpServletResponse response)
          This method is call for each request.
protected  boolean processValidate(HttpServletRequest request, HttpServletResponse response, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
           
 
Methods inherited from class org.apache.struts.tiles.TilesRequestProcessor
doForward, getDefinitionsFactory, initDefinitionsMapping, internalModuleRelativeForward, internalModuleRelativeInclude, processTilesDefinition
 
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doInclude, getDebug, getInternal, getServletContext, log, log, process, processActionCreate, processActionForm, processActionForward, processActionPerform, processContent, processException, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPopulate, 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
Commons Logging instance.

Constructor Detail

ExpressoRequestProcessor

public ExpressoRequestProcessor()
Default constructor

Method Detail

createAction

public org.apache.struts.action.Action createAction(String className)
Creates and return the Action controller. Request processor normally cache there action instances internally, therefore only an Action is normally created just once.

Parameters:
className - the class name of the action to create
Returns:
the action controller or null if the action cannot be created at all.

init

public void init(org.apache.struts.action.ActionServlet servlet,
                 org.apache.struts.config.ModuleConfig moduleConfig)
          throws ServletException
Initialize this request processor instance.

Parameters:
servlet - The ActionServlet we are associated with
moduleConfig - The ModuleConfig we are associated with.
Throws:
ServletException - If an error occur during initialization

processPrepocess

public boolean processPrepocess(HttpServletRequest request,
                                HttpServletResponse response)
This method is call for each request. By default it does nothing with the requests, but Expresso Framework may use this call in the future to handle security and authentication.

Parameters:
request - The servlet request object
response - The servlet response object
Returns:
true if successful

processForwardConfig

protected void processForwardConfig(HttpServletRequest request,
                                    HttpServletResponse response,
                                    org.apache.struts.config.ForwardConfig forward)
                             throws IOException,
                                    ServletException
This method was created specifically to allow dynamic URL forwarding since we cannot muck with the Struts 1.1 configuration due to the 'freeze()' method. It checks for

Parameters:
request - The servlet request
response - The servlet response
forward - the default forward config that Struts was handed by the controller
Throws:
IOException
ServletException

processPath

protected String processPath(HttpServletRequest httpServletRequest,
                             HttpServletResponse httpServletResponse)
                      throws IOException
subclass in order to allow ExpressoActionServlet to be a dispatcher for any finite-state-machine request which includes parameters for controller & state. if ExpressoActionServlet does not play this role, URLs must have a known controller embedded, which is not good for a JSP, for example, that isn't supposed to know about controllers. instead, ExpressoServletAction can be the "universal dispatcher"

Identify and return the path component (from the request URI) that we will use to select an ActionMapping with which to dispatch. If no such path can be identified, create an error response and return null.

Parameters:
httpServletRequest - The servlet request we are processing
Returns:
String
Throws:
IOException

processValidate

protected boolean processValidate(HttpServletRequest request,
                                  HttpServletResponse response,
                                  org.apache.struts.action.ActionForm form,
                                  org.apache.struts.action.ActionMapping mapping)
                           throws IOException,
                                  ServletException
Throws:
IOException
ServletException

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.