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

java.lang.Object
  extended byorg.springframework.context.support.ApplicationObjectSupport
      extended byorg.springframework.web.context.support.WebApplicationObjectSupport
          extended byorg.springframework.web.servlet.view.tiles.TilesConfigurer
All Implemented Interfaces:
ApplicationContextAware

public class TilesConfigurer
extends WebApplicationObjectSupport

Helper class to configure Tiles for the Spring Framework (see http://jakarta.apache.org/struts for more information about Tiles, which basically is a templating mechanism for JSP-based web applications).

The TilesConfigurer simply configures tiles using a set of files containing definitions. The rest is done by an appropriate Resolver which could for instance be the InternalResourceViewResolver or the ResourceBundleViewResolver. Usage of the TilesConfigurer is done as follows:

  <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
       <property name="definitions">
           <list>
               <value>/WEB-INF/defs/general.xml</value>
               <value>/WEB-INF/defs/widgets.xml</value>
               <value>/WEB-INF/defs/administrator.xml</value>
               <value>/WEB-INF/defs/customer.xml</value>
               <value>/WEB-INF/defs/templates.xml</value>
           </list>
       </property>
  </bean>
 

The values in the list are the actual files containing the definitions.

Author:
Alef Arendsen, Juergen Hoeller
See Also:
TilesView

Field Summary
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
TilesConfigurer()
           
 
Method Summary
protected  void initApplicationContext()
          Initialization of the Tiles definition factory.
 void setDefinitions(java.lang.String[] definitions)
          Set the Tiles definitions, i.e.
 void setFactoryClass(java.lang.Class factoryClass)
          Set the factory class for Tiles.
 void setValidateDefinitions(boolean validateDefinitions)
          Validate the Tiles definitions? Default is false.
 
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, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TilesConfigurer

public TilesConfigurer()
Method Detail

setFactoryClass

public void setFactoryClass(java.lang.Class factoryClass)
Set the factory class for Tiles. Default is I18nFactorySet.

See Also:
I18nFactorySet

setValidateDefinitions

public void setValidateDefinitions(boolean validateDefinitions)
Validate the Tiles definitions? Default is false.

Parameters:
validateDefinitions - true to validate, false otherwise

setDefinitions

public void setDefinitions(java.lang.String[] definitions)
Set the Tiles definitions, i.e. the list of files.

Parameters:
definitions - the files containing the definitions

initApplicationContext

protected void initApplicationContext()
                               throws ApplicationContextException
Initialization of the Tiles definition factory.

Overrides:
initApplicationContext in class ApplicationObjectSupport
Throws:
ApplicationContextException - if an error occurs


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