org.springframework.web.struts
Class ActionSupport

|
+--org.springframework.web.struts.ActionSupport

public abstract class ActionSupport
extends Action

Convenience class for Spring-aware Struts 1.1/1.2 Actions.

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 Struts DispatchActions or Lookup/MappingDispatchActions, use the analogous DispatchActionSupport or LookupDispatchActionSupport / MappingDispatchActionSupport class, respectively.

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.

Author:
Juergen Hoeller
Since: 1.0.1
See Also: ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX, org.springframework.web.context.WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ContextLoaderListener, ContextLoaderServlet, DispatchActionSupport, LookupDispatchActionSupport, MappingDispatchActionSupport, DelegatingActionProxy, DelegatingRequestProcessor

Method Summary
 voidsetServlet(ActionServlet actionServlet)
          Initialize the WebApplicationContext for this Action.

Method Detail

setServlet

public void setServlet(ActionServlet actionServlet)
Initialize the WebApplicationContext for this Action. Invokes onInit after successful initialization of the context.
See Also:
initWebApplicationContext(ActionServlet), onInit()

Association Links

to Class org.springframework.web.context.WebApplicationContext

to Class org.springframework.context.support.MessageSourceAccessor