public abstract class

ComponentControllerSupport

extends ControllerSupport
java.lang.Object
   ↳ ControllerSupport
     ↳ org.springframework.web.servlet.view.tiles.ComponentControllerSupport

This class is deprecated.
as of Spring 3.0

Class Overview

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 the Tiles ControllerSupport class rather than implementing the Tiles org.apache.struts.tiles.Controller interface in order 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.

Summary

Public Constructors
ComponentControllerSupport()
Public Methods
final void execute(ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
This implementation delegates to doPerform, lazy-initializing the application context reference if necessary.
final void perform(ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
This implementation delegates to execute, converting non-Servlet/IO Exceptions to ServletException.
Protected Methods
abstract void doPerform(ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response)
Perform the preparation for the component, allowing for any Exception to be thrown.
final ApplicationContext getApplicationContext()
Return the current Spring ApplicationContext.
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.
void initApplicationContext()
Subclasses can override this for custom initialization behavior.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ComponentControllerSupport ()

Public Methods

public final void execute (ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)

This implementation delegates to 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.

Throws
Exception

public final void perform (ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)

This implementation delegates to execute, converting non-Servlet/IO Exceptions to ServletException.

This is the only execution method available in Struts 1.1.

Throws
IOException
ServletException

Protected Methods

protected abstract void doPerform (ComponentContext componentContext, HttpServletRequest request, HttpServletResponse response)

Perform the preparation for the component, allowing for any Exception to be thrown. The ServletContext can be retrieved via getServletContext, if necessary. The Spring WebApplicationContext can be accessed via getWebApplicationContext.

This method will be called both in the Struts 1.1 and Struts 1.2 case, by perform or execute, respectively.

Parameters
componentContext current Tiles component context
request current HTTP request
response current HTTP response
Throws
Exception in case of errors

protected final ApplicationContext getApplicationContext ()

Return the current Spring ApplicationContext.

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 void initApplicationContext ()

Subclasses can override this for custom initialization behavior. Gets called on initialization of the context for this controller.

Throws
ApplicationContextException in case of initialization errors
BeansException if thrown by application context methods