@Deprecated
public abstract class LookupDispatchActionSupport
extends LookupDispatchAction
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
.
ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX
,
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
,
ContextLoaderListener
,
ActionSupport
,
DispatchActionSupport
,
MappingDispatchActionSupport
,
DelegatingActionProxy
,
DelegatingRequestProcessor
Modifier and Type | Field and Description |
---|---|
private MessageSourceAccessor |
messageSourceAccessor
Deprecated.
|
private WebApplicationContext |
webApplicationContext
Deprecated.
|
Constructor and Description |
---|
LookupDispatchActionSupport()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected MessageSourceAccessor |
getMessageSourceAccessor()
Deprecated.
Return a MessageSourceAccessor for the application context
used by this object, for easy message access.
|
protected ServletContext |
getServletContext()
Deprecated.
Return the current ServletContext.
|
protected java.io.File |
getTempDir()
Deprecated.
Return the temporary directory for the current web application,
as provided by the servlet container.
|
protected WebApplicationContext |
getWebApplicationContext()
Deprecated.
Return the current Spring WebApplicationContext.
|
protected WebApplicationContext |
initWebApplicationContext(ActionServlet actionServlet)
Deprecated.
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext,
falling back to the root WebApplicationContext (the usual case).
|
protected void |
onDestroy()
Deprecated.
Callback for custom destruction when the ActionServlet shuts down.
|
protected void |
onInit()
Deprecated.
Callback for custom initialization after the context has been set up.
|
void |
setServlet(ActionServlet actionServlet)
Deprecated.
Initialize the WebApplicationContext for this Action.
|
private WebApplicationContext webApplicationContext
private MessageSourceAccessor messageSourceAccessor
public void setServlet(ActionServlet actionServlet)
protected WebApplicationContext initWebApplicationContext(ActionServlet actionServlet) throws java.lang.IllegalStateException
actionServlet
- the associated ActionServletjava.lang.IllegalStateException
- if no WebApplicationContext could be foundDelegatingActionUtils.findRequiredWebApplicationContext(ActionServlet, ModuleConfig)
protected final WebApplicationContext getWebApplicationContext()
protected final MessageSourceAccessor getMessageSourceAccessor()
protected final ServletContext getServletContext()
protected final java.io.File getTempDir()
protected void onInit()
setServlet(ActionServlet)
protected void onDestroy()
setServlet(ActionServlet)