public abstract class

LookupDispatchActionSupport

extends LookupDispatchAction
java.lang.Object
   ↳ LookupDispatchAction
     ↳ org.springframework.web.struts.LookupDispatchActionSupport

This class is deprecated.
as of Spring 3.0

Class Overview

Convenience class for Spring-aware Struts 1.1+ LookupDispatchActions.

Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading. Auto-detects a ContextLoaderPlugIn context, falling back to the root WebApplicationContext. For typical usage, i.e. accessing middle tier beans, use a root WebApplicationContext.

For classic Struts Actions, DispatchActions or MappingDispatchActions, use the analogous ActionSupport or DispatchActionSupport / MappingDispatchActionSupport class.

As an alternative approach, you can wire your Struts Actions themselves as Spring beans, passing references to them via IoC rather than looking up references in a programmatic fashion. Check out DelegatingActionProxy and DelegatingRequestProcessor.

Summary

Public Constructors
LookupDispatchActionSupport()
Public Methods
void setServlet(ActionServlet actionServlet)
Initialize the WebApplicationContext for this Action.
Protected Methods
final MessageSourceAccessor getMessageSourceAccessor()
Return a MessageSourceAccessor for the application context used by this object, for easy message access.
final ServletContext getServletContext()
Return the current ServletContext.
final File getTempDir()
Return the temporary directory for the current web application, as provided by the servlet container.
final WebApplicationContext getWebApplicationContext()
Return the current Spring WebApplicationContext.
WebApplicationContext initWebApplicationContext(ActionServlet actionServlet)
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).
void onDestroy()
Callback for custom destruction when the ActionServlet shuts down.
void onInit()
Callback for custom initialization after the context has been set up.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public LookupDispatchActionSupport ()

Public Methods

public void setServlet (ActionServlet actionServlet)

Initialize the WebApplicationContext for this Action. Invokes onInit after successful initialization of the context.

Protected Methods

protected final MessageSourceAccessor getMessageSourceAccessor ()

Return a MessageSourceAccessor for the application context used by this object, for easy message access.

protected final ServletContext getServletContext ()

Return the current ServletContext.

protected final File getTempDir ()

Return the temporary directory for the current web application, as provided by the servlet container.

Returns
  • the File representing the temporary directory

protected final WebApplicationContext getWebApplicationContext ()

Return the current Spring WebApplicationContext.

protected WebApplicationContext initWebApplicationContext (ActionServlet actionServlet)

Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case).

Parameters
actionServlet the associated ActionServlet
Returns
  • the WebApplicationContext
Throws
IllegalStateException if no WebApplicationContext could be found

protected void onDestroy ()

Callback for custom destruction when the ActionServlet shuts down.

protected void onInit ()

Callback for custom initialization after the context has been set up.