类 TilesConfigurer
- java.lang.Object
- org.springframework.web.servlet.view.tiles2.TilesConfigurer
- 所有已实现的接口:
Aware
,DisposableBean
,InitializingBean
,ServletContextAware
@Deprecated public class TilesConfigurer extends Object implements ServletContextAware, InitializingBean, DisposableBean
已过时。as of Spring 4.2, in favor of Tiles 3Helper class to configure Tiles 2.x for the Spring Framework. See https://tiles.apache.org for more information about Tiles, which basically is a templating mechanism for web applications using JSPs and other template engines. Note: Spring 4.0 requires Tiles 2.2.2. Tiles' EL support will be activated by default when the Tiles EL module is present in the classpath.The TilesConfigurer simply configures a TilesContainer using a set of files containing definitions, to be accessed by
TilesView
instances. This is a Spring-based alternative (for usage in Spring configuration) to the Tiles-providedServletContextListener
(e.g.CompleteAutoloadTilesListener
for usage inweb.xml
.TilesViews can be managed by any
ViewResolver
. For simple convention-based view resolution, consider usingTilesViewResolver
.A typical TilesConfigurer bean definition looks as follows:
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.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 Tiles XML files containing the definitions. If the list is not specified, the default is"/WEB-INF/tiles.xml"
.NOTE: Tiles 2 support is deprecated in favor of Tiles 3 and will be removed as of Spring Framework 5.0..
- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
TilesView
,TilesViewResolver
构造器概要
构造器 构造器 说明 TilesConfigurer()
已过时。
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
已过时。Creates and exposes a TilesContainer for this web application, delegating to the TilesInitializer.protected TilesInitializer
createTilesInitializer()
已过时。Creates a new instance ofSpringTilesInitializer
.void
destroy()
已过时。Removes the TilesContainer from this web application.void
setCheckRefresh(boolean checkRefresh)
已过时。Set whether to check Tiles definition files for a refresh at runtime.void
setCompleteAutoload(boolean completeAutoload)
已过时。Specify whether to apply Tiles 2.2's "complete-autoload" configuration.void
setDefinitions(String... definitions)
已过时。Set the Tiles definitions, i.e. the list of files containing the definitions.void
setDefinitionsFactoryClass(Class<? extends DefinitionsFactory> definitionsFactoryClass)
已过时。Set theDefinitionsFactory
implementation to use.void
setPreparerFactoryClass(Class<? extends PreparerFactory> preparerFactoryClass)
已过时。Set thePreparerFactory
implementation to use.void
setServletContext(ServletContext servletContext)
已过时。Set theServletContext
that this object runs in.void
setTilesInitializer(TilesInitializer tilesInitializer)
已过时。Configure Tiles using a custom TilesInitializer, typically specified as an inner bean.void
setUseMutableTilesContainer(boolean useMutableTilesContainer)
已过时。Set whether to use a MutableTilesContainer (typically the CachingTilesContainer implementation) for this application.void
setValidateDefinitions(boolean validateDefinitions)
已过时。Set whether to validate the Tiles XML definitions.
构造器详细资料
TilesConfigurer
public TilesConfigurer()
已过时。
方法详细资料
setTilesInitializer
public void setTilesInitializer(TilesInitializer tilesInitializer)
已过时。Configure Tiles using a custom TilesInitializer, typically specified as an inner bean.Default is a variant of
DefaultTilesInitializer
, respecting the "definitions", "preparerFactoryClass" etc properties on this configurer.NOTE: Specifying a custom TilesInitializer effectively disables all other bean properties on this configurer. The entire initialization procedure is then left to the TilesInitializer as specified.
setCompleteAutoload
public void setCompleteAutoload(boolean completeAutoload)
已过时。Specify whether to apply Tiles 2.2's "complete-autoload" configuration.See
CompleteAutoloadTilesContainerFactory
for details on the complete-autoload mode.NOTE: Specifying the complete-autoload mode effectively disables all other bean properties on this configurer. The entire initialization procedure is then left to
CompleteAutoloadTilesInitializer
.
setDefinitions
public void setDefinitions(String... definitions)
已过时。Set the Tiles definitions, i.e. the list of files containing the definitions. Default is "/WEB-INF/tiles.xml".
setCheckRefresh
public void setCheckRefresh(boolean checkRefresh)
已过时。Set whether to check Tiles definition files for a refresh at runtime. Default is "false".
setValidateDefinitions
public void setValidateDefinitions(boolean validateDefinitions)
已过时。Set whether to validate the Tiles XML definitions. Default is "true".
setDefinitionsFactoryClass
public void setDefinitionsFactoryClass(Class<? extends DefinitionsFactory> definitionsFactoryClass)
已过时。Set theDefinitionsFactory
implementation to use. Default isUnresolvingLocaleDefinitionsFactory
, operating on definition resource URLs.Specify a custom DefinitionsFactory, e.g. a UrlDefinitionsFactory subclass, to customize the creation of Tiles Definition objects. Note that such a DefinitionsFactory has to be able to handle
URL
source objects, unless you configure a different TilesContainerFactory.
setPreparerFactoryClass
public void setPreparerFactoryClass(Class<? extends PreparerFactory> preparerFactoryClass)
已过时。Set thePreparerFactory
implementation to use. Default isBasicPreparerFactory
, creating shared instances for specified preparer classes.Specify
SimpleSpringPreparerFactory
to autowireViewPreparer
instances based on specified preparer classes, applying Spring's container callbacks as well as applying configured Spring BeanPostProcessors. If Spring's context-wide annotation-config has been activated, annotations in ViewPreparer classes will be automatically detected and applied.Specify
SpringBeanPreparerFactory
to operate on specified preparer names instead of classes, obtaining the corresponding Spring bean from the DispatcherServlet's application context. The full bean creation process will be in the control of the Spring application context in this case, allowing for the use of scoped beans etc. Note that you need to define one Spring bean definition per preparer name (as used in your Tiles definitions).
setUseMutableTilesContainer
public void setUseMutableTilesContainer(boolean useMutableTilesContainer)
已过时。Set whether to use a MutableTilesContainer (typically the CachingTilesContainer implementation) for this application. Default is "false".
setServletContext
public void setServletContext(ServletContext servletContext)
已过时。从接口复制的说明:ServletContextAware
Set theServletContext
that this object runs in.Invoked after population of normal bean properties but before an init callback like InitializingBean's
afterPropertiesSet
or a custom init-method. Invoked after ApplicationContextAware'ssetApplicationContext
.- 指定者:
setServletContext
在接口中ServletContextAware
- 参数:
servletContext
- ServletContext object to be used by this object- 另请参阅:
InitializingBean.afterPropertiesSet()
,ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
afterPropertiesSet
public void afterPropertiesSet() throws TilesException
已过时。Creates and exposes a TilesContainer for this web application, delegating to the TilesInitializer.- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
TilesException
- in case of setup failure
createTilesInitializer
protected TilesInitializer createTilesInitializer()
已过时。Creates a new instance ofSpringTilesInitializer
.Override it to use a different initializer.
destroy
public void destroy() throws TilesException
已过时。Removes the TilesContainer from this web application.- 指定者:
destroy
在接口中DisposableBean
- 抛出:
TilesException
- in case of cleanup failure