Class TilesConfigurer

  extended by
      extended by
          extended by org.springframework.web.servlet.view.tiles.TilesConfigurer
All Implemented Interfaces:
InitializingBean, ApplicationContextAware, ServletContextAware

public class TilesConfigurer
extends WebApplicationObjectSupport
implements InitializingBean

Helper class to configure Tiles 1.x for the Spring Framework. See for more information about Struts Tiles, which basically is a templating mechanism for JSP-based web applications.

NOTE: This TilesConfigurer class supports Tiles 1.x, a.k.a. "Struts Tiles", which comes as part of Struts 1.x. For Tiles 2.x support, check out TilesConfigurer.

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. For simple convention-based view resolution, consider using UrlBasedViewResolver with the "viewClass" property set to "org.springframework.web.servlet.view.tiles.TilesView".

A typical TilesConfigurer bean definition looks as follows:

 <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
   <property name="definitions">
The values in the list are the actual files containing the definitions.

Alef Arendsen, Juergen Hoeller
See Also:
TilesView, UrlBasedViewResolver

Field Summary
Fields inherited from class
Constructor Summary
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 XML definitions.
Methods inherited from class
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class
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


public TilesConfigurer()
Method Detail


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


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


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

See Also:


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

Specified by:
afterPropertiesSet in interface InitializingBean
DefinitionsFactoryException - if an error occurs
See Also:


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

factoryConfig - the configuration for the DefinitionsFactory
the DefinitionsFactory
DefinitionsFactoryException - if an error occurs

Copyright © 2002-2008 The Spring Framework.