org.figure8.join.control
Class DelegatingSpringRequestProcessor

java.lang.Object
  extended by org.apache.struts.action.RequestProcessor
      extended by org.apache.struts.tiles.TilesRequestProcessor
          extended by org.figure8.join.control.DelegatingSpringRequestProcessor

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

This is an extension of Struts RequestProcessor that delegates the action creation to Spring if a context is available ... Otherwise the default behaviour implemented into Struts is used (ie. instanciation of action class)

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux

Field Summary
 
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
DelegatingSpringRequestProcessor()
           
 
Method Summary
protected  java.lang.String determineActionBeanName(org.apache.struts.action.ActionMapping mapping)
          Determine the name of the Action bean, to be looked up in the WebApplicationContext.
protected  org.apache.struts.action.Action getDelegateAction(org.apache.struts.action.ActionMapping mapping)
          Return the delegate Action for the given mapping.
protected  org.apache.struts.action.Action processActionCreate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
          Override the base class method to return the delegate action.
 
Methods inherited from class org.apache.struts.tiles.TilesRequestProcessor
doForward, getDefinitionsFactory, init, initDefinitionsMapping, internalModuleRelativeForward, internalModuleRelativeInclude, processForwardConfig, processTilesDefinition
 
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doInclude, getInternal, getServletContext, log, log, process, processActionForm, processActionPerform, processCachedMessages, processContent, processException, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles, processValidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingSpringRequestProcessor

public DelegatingSpringRequestProcessor()
Method Detail

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
Override the base class method to return the delegate action.

Overrides:
processActionCreate in class org.apache.struts.action.RequestProcessor
Parameters:
request - The servlet container request wrapper
response - The servlet container response wrapper
mapping - The mappings available for this action
Returns:
The corresponding action instance.
Throws:
java.io.IOException

getDelegateAction

protected org.apache.struts.action.Action getDelegateAction(org.apache.struts.action.ActionMapping mapping)
                                                     throws InvalidParameterException
Return the delegate Action for the given mapping.

The default implementation determines a bean name from the given ActionMapping and looks up the corresponding bean in the WebApplicationContext.

Parameters:
mapping - the Struts ActionMapping
Returns:
the delegate Action
Throws:
InvalidParameterException
See Also:
determineActionBeanName(org.apache.struts.action.ActionMapping)

determineActionBeanName

protected java.lang.String determineActionBeanName(org.apache.struts.action.ActionMapping mapping)
Determine the name of the Action bean, to be looked up in the WebApplicationContext.

The default implementation takes the mapping path and prepends the module prefix, if any.

Parameters:
mapping - the Struts ActionMapping
Returns:
the name of the Action bean
See Also:
DelegatingActionUtils.determineActionBeanName(org.apache.struts.action.ActionMapping), ActionConfig.getPath()


Copyright © 2005-2008 Join. All Rights Reserved.