|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.action.Action org.springframework.web.struts.ActionSupport
Convenience class for Spring-aware Struts 1.1 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.
ContextLoaderPlugIn.SERVLET_CONTEXT_ATTRIBUTE
,
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
,
ContextLoaderListener
,
ContextLoaderServlet
Field Summary |
Fields inherited from class org.apache.struts.action.Action |
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY |
Constructor Summary | |
ActionSupport()
|
Method Summary | |
protected MessageSourceAccessor |
getMessageSourceAccessor()
Return a MessageSourceAccessor for the application context used by this object, for easy message access. |
protected javax.servlet.ServletContext |
getServletContext()
Return the current ServletContext. |
protected java.io.File |
getTempDir()
Return the temporary directory for the current web application, as provided by the servlet container. |
protected WebApplicationContext |
getWebApplicationContext()
Return the current Spring WebApplicationContext. |
protected WebApplicationContext |
initWebApplicationContext(org.apache.struts.action.ActionServlet actionServlet)
Fetch ContextLoaderPlugIn's WebApplicationContext from the ServletContext, falling back to the root WebApplicationContext (the usual case). |
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. |
void |
setServlet(org.apache.struts.action.ActionServlet actionServlet)
Initialize the WebApplicationContext for this Action. |
Methods inherited from class org.apache.struts.action.Action |
execute, execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, toHex |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ActionSupport()
Method Detail |
public void setServlet(org.apache.struts.action.ActionServlet actionServlet)
initWebApplicationContext(org.apache.struts.action.ActionServlet)
,
onInit()
protected WebApplicationContext initWebApplicationContext(org.apache.struts.action.ActionServlet actionServlet) throws java.lang.IllegalStateException
actionServlet
- the associated ActionServlet
java.lang.IllegalStateException
- if no WebApplicationContext could be foundContextLoaderPlugIn.SERVLET_CONTEXT_ATTRIBUTE
,
WebApplicationContextUtils.getWebApplicationContext(javax.servlet.ServletContext)
protected final WebApplicationContext getWebApplicationContext()
protected final MessageSourceAccessor getMessageSourceAccessor()
protected final javax.servlet.ServletContext getServletContext()
protected final java.io.File getTempDir()
protected void onInit()
setServlet(org.apache.struts.action.ActionServlet)
protected void onDestroy()
setServlet(org.apache.struts.action.ActionServlet)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |