use of org.apache.tiles.request.ApplicationContext in project spring-framework by spring-projects.
the class TilesConfigurer method afterPropertiesSet.
/**
* Creates and exposes a TilesContainer for this web application,
* delegating to the TilesInitializer.
* @throws TilesException in case of setup failure
*/
@Override
public void afterPropertiesSet() throws TilesException {
ApplicationContext preliminaryContext = new SpringWildcardServletTilesApplicationContext(this.servletContext);
if (this.tilesInitializer == null) {
this.tilesInitializer = new SpringTilesInitializer();
}
this.tilesInitializer.initialize(preliminaryContext);
}
use of org.apache.tiles.request.ApplicationContext in project spring-framework by spring-projects.
the class TilesConfigurerTests method simpleBootstrap.
@Test
public void simpleBootstrap() {
MockServletContext servletContext = new MockServletContext();
TilesConfigurer tc = new TilesConfigurer();
tc.setDefinitions("/org/springframework/web/servlet/view/tiles3/tiles-definitions.xml");
tc.setCheckRefresh(true);
tc.setServletContext(servletContext);
tc.afterPropertiesSet();
ApplicationContext tilesContext = ServletUtil.getApplicationContext(servletContext);
BasicTilesContainer container = (BasicTilesContainer) TilesAccess.getContainer(tilesContext);
Request requestContext = new ServletRequest(container.getApplicationContext(), new MockHttpServletRequest(), new MockHttpServletResponse());
assertNotNull(container.getDefinitionsFactory().getDefinition("test", requestContext));
tc.destroy();
}
Aggregations