org.springframework.web.servlet.view.tiles
Class ComponentControllerSupport

java.lang.Object
  extended byorg.springframework.context.support.ApplicationObjectSupport
      extended byorg.springframework.web.context.support.WebApplicationObjectSupport
          extended byorg.springframework.web.servlet.view.tiles.ComponentControllerSupport
All Implemented Interfaces:
ApplicationContextAware, org.apache.struts.tiles.Controller

public abstract class ComponentControllerSupport
extends WebApplicationObjectSupport
implements org.apache.struts.tiles.Controller

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.

Since:
22.08.2003
Author:
Juergen Hoeller, Alef Arendsen

Field Summary
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
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 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 doPerform, lazy-initializing the application context reference if necessary, and converting non-Servlet/IO Exceptions to ServletException.
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, requiredContextClass
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentControllerSupport

public ComponentControllerSupport()
Method Detail

perform

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
This implementation delegates to doPerform, lazy-initializing the application context reference if necessary, and converting non-Servlet/IO Exceptions to ServletException.

Specified by:
perform in interface org.apache.struts.tiles.Controller
Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
doPerform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doPerform

protected abstract void doPerform(org.apache.struts.tiles.ComponentContext componentContext,
                                  javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
                           throws java.lang.Exception
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.

Parameters:
componentContext - current Tiles component context
request - current HTTP request
response - current HTTP response
Throws:
java.lang.Exception - in case of errors
See Also:
Controller.perform(org.apache.struts.tiles.ComponentContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext), WebApplicationObjectSupport.getServletContext(), WebApplicationObjectSupport.getWebApplicationContext()


Copyright (C) 2003-2004 The Spring Framework Project.