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

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

public class TilesConfigurer
extends WebApplicationObjectSupport
implements InitializingBean

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 a Tiles DefinitionsFactory using a set of files containing definitions, to be accessed by TilesView instances. TilesViews can be managed by any ViewResolver.

A typical TilesConfigurer bean definition looks 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, ViewResolver

Field Summary
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
TilesConfigurer()
           
 
Method Summary
 void afterPropertiesSet()
          Initialize the Tiles definition factory.
protected  DefinitionsFactory createDefinitionsFactory(DefinitionsFactoryConfig factoryConfig)
          Create the Tiles DefinitionsFactory and expose it to the ServletContext.
 void setDefinitions(String[] definitions)
          Set the Tiles definitions, i.e. the list of files containing the definitions.
 void setFactoryClass(Class factoryClass)
          Set the factory class for Tiles.
 void setValidateDefinitions(boolean validateDefinitions)
          Set whether to validate the Tiles definitions.
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, 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(Class factoryClass)
Set the factory class for Tiles. Default is I18nFactorySet.

See Also:
I18nFactorySet

setValidateDefinitions

public void setValidateDefinitions(boolean validateDefinitions)
Set whether to validate the Tiles definitions. Default is "true".


setDefinitions

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


afterPropertiesSet

public void afterPropertiesSet()
                        throws DefinitionsFactoryException
Initialize the Tiles definition factory. Delegates to createDefinitionsFactory for the actual creation.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
DefinitionsFactoryException - if an error occurs
See Also:
createDefinitionsFactory(org.apache.struts.tiles.DefinitionsFactoryConfig)

createDefinitionsFactory

protected DefinitionsFactory createDefinitionsFactory(DefinitionsFactoryConfig factoryConfig)
                                               throws DefinitionsFactoryException
Create the Tiles DefinitionsFactory and expose it to the ServletContext.

Parameters:
factoryConfig - the configuration for the DefinitionsFactory
Returns:
the DefinitionsFactory
Throws:
DefinitionsFactoryException - if an error occurs


Copyright (c) 2002-2007 The Spring Framework Project.