|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.tiles.ControllerSupport org.springframework.web.servlet.view.tiles.ComponentControllerSupport
Convenience class for Spring-aware Tiles component controllers. Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading.
Derives from Tiles' ControllerSupport class rather than
implementing Tiles' Controller interface to be compatible with
Struts 1.1 and 1.2. Implements both Struts 1.1's perform
and Struts 1.2's execute
method accordingly.
WebApplicationObjectSupport
Constructor Summary | |
ComponentControllerSupport()
|
Method Summary | |
protected abstract void |
doPerform(org.apache.struts.tiles.ComponentContext componentContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Perform the preparation for the component, allowing for any Exception to be thrown. |
void |
execute(org.apache.struts.tiles.ComponentContext componentContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext)
This implementation delegates to doPerform ,
lazy-initializing the application context reference if necessary.
|
protected ApplicationContext |
getApplicationContext()
Return the current Spring ApplicationContext. |
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 void |
initApplicationContext()
Subclasses can override this for custom initialization behavior. |
void |
perform(org.apache.struts.tiles.ComponentContext componentContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext)
This implementation delegates to execute ,
converting non-Servlet/IO Exceptions to ServletException.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ComponentControllerSupport()
Method Detail |
public final void perform(org.apache.struts.tiles.ComponentContext componentContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext) throws javax.servlet.ServletException, java.io.IOException
execute
,
converting non-Servlet/IO Exceptions to ServletException.
This is the only execution method available in Struts 1.1.
javax.servlet.ServletException
java.io.IOException
execute(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext)
public final void execute(org.apache.struts.tiles.ComponentContext componentContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext) throws java.lang.Exception
doPerform
,
lazy-initializing the application context reference if necessary.
This is the preferred execution method in Struts 1.2.
When running with Struts 1.1, it will be called by perform
.
java.lang.Exception
perform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext)
,
doPerform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
protected void initApplicationContext() throws BeansException
ApplicationContextException
- in case of initialization errors
BeansException
- if thrown by application context methodsprotected final ApplicationContext getApplicationContext()
protected final WebApplicationContext getWebApplicationContext()
protected final MessageSourceAccessor getMessageSourceAccessor()
protected final javax.servlet.ServletContext getServletContext()
protected final java.io.File getTempDir()
protected abstract void doPerform(org.apache.struts.tiles.ComponentContext componentContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
This method will be called both in the Struts 1.1 and Struts 1.2 case,
by perform
respectively execute
.
componentContext
- current Tiles component contextrequest
- current HTTP requestresponse
- current HTTP response
java.lang.Exception
- in case of errorsController.perform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext)
,
getServletContext()
,
getWebApplicationContext()
,
perform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext)
,
execute(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |