org.springframework.web.struts
Class DelegatingActionUtils

java.lang.Object
  extended byorg.springframework.web.struts.DelegatingActionUtils

public abstract class DelegatingActionUtils
extends java.lang.Object

Common methods for various ways to make Struts delegate to Spring-managed Actions.

As everything in Struts is based on concrete inheritance, we have to provide an Action subclass (DelegatingActionProxy) and two RequestProcessor subclasses (DelegatingRequestProcessor and DelegatingTilesRequestProcessor). The only way to share common functionality is a utility class like this one.

Since:
26.04.2004
Author:
Juergen Hoeller
See Also:
DelegatingActionProxy, DelegatingRequestProcessor, DelegatingTilesRequestProcessor

Field Summary
protected static org.apache.commons.logging.Log logger
           
 
Constructor Summary
DelegatingActionUtils()
           
 
Method Summary
static java.lang.String determineActionBeanName(org.apache.struts.action.ActionMapping mapping)
          Default implementation of Action bean determination, taking the mapping path and prepending the module prefix, if any.
static WebApplicationContext initWebApplicationContext(org.apache.struts.action.ActionServlet actionServlet)
          Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, containing the Struts Action beans to delegate to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger
Constructor Detail

DelegatingActionUtils

public DelegatingActionUtils()
Method Detail

initWebApplicationContext

public static WebApplicationContext initWebApplicationContext(org.apache.struts.action.ActionServlet actionServlet)
                                                       throws java.lang.IllegalStateException
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, containing the Struts Action beans to delegate to.

Parameters:
actionServlet - the associated ActionServlet
Returns:
the WebApplicationContext
Throws:
java.lang.IllegalStateException - if no WebApplicationContext could be found
See Also:
ContextLoaderPlugIn.SERVLET_CONTEXT_ATTRIBUTE

determineActionBeanName

public static java.lang.String determineActionBeanName(org.apache.struts.action.ActionMapping mapping)
Default implementation of Action bean determination, taking the mapping path and prepending the module prefix, if any.

Parameters:
mapping - the Struts ActionMapping
Returns:
the name of the Action bean
See Also:
ActionConfig.getPath(), ModuleConfig.getPrefix()


Copyright (C) 2003-2004 The Spring Framework Project.