Java Code Examples for org.springframework.web.servlet.view.tiles3.TilesConfigurer

The following examples show how to use org.springframework.web.servlet.view.tiles3.TilesConfigurer. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note   Source File: ViewResolverRegistry.java    License: MIT License 5 votes vote down vote up
/**
 * Register Tiles 3.x view resolver.
 * <p><strong>Note</strong> that you must also configure Tiles by adding a
 * {@link org.springframework.web.servlet.view.tiles3.TilesConfigurer} bean.
 */
public UrlBasedViewResolverRegistration tiles() {
	if (!checkBeanOfType(TilesConfigurer.class)) {
		throw new BeanInitializationException("In addition to a Tiles view resolver " +
				"there must also be a single TilesConfigurer bean in this web application context " +
				"(or its parent).");
	}
	TilesRegistration registration = new TilesRegistration();
	this.viewResolvers.add(registration.getViewResolver());
	return registration;
}
 
Example 2
Source Project: spring-analysis-note   Source File: ViewResolverRegistryTests.java    License: MIT License 5 votes vote down vote up
@Before
public void setup() {
	StaticWebApplicationContext context = new StaticWebApplicationContext();
	context.registerSingleton("freeMarkerConfigurer", FreeMarkerConfigurer.class);
	context.registerSingleton("tilesConfigurer", TilesConfigurer.class);
	context.registerSingleton("groovyMarkupConfigurer", GroovyMarkupConfigurer.class);
	context.registerSingleton("scriptTemplateConfigurer", ScriptTemplateConfigurer.class);

	this.registry = new ViewResolverRegistry(new ContentNegotiationManager(), context);
}
 
Example 3
Source Project: Project   Source File: WebConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public TilesConfigurer tilesConfigurer() {
  TilesConfigurer tiles = new TilesConfigurer();
  tiles.setDefinitions(new String[] {
      "/WEB-INF/layout/tiles.xml",
      "/WEB-INF/views/**/tiles.xml"
  });
  tiles.setCheckRefresh(true);
  return tiles;
}
 
Example 4
Source Project: java-technology-stack   Source File: ViewResolverRegistry.java    License: MIT License 5 votes vote down vote up
/**
 * Register Tiles 3.x view resolver.
 * <p><strong>Note</strong> that you must also configure Tiles by adding a
 * {@link org.springframework.web.servlet.view.tiles3.TilesConfigurer} bean.
 */
public UrlBasedViewResolverRegistration tiles() {
	if (!checkBeanOfType(TilesConfigurer.class)) {
		throw new BeanInitializationException("In addition to a Tiles view resolver " +
				"there must also be a single TilesConfigurer bean in this web application context " +
				"(or its parent).");
	}
	TilesRegistration registration = new TilesRegistration();
	this.viewResolvers.add(registration.getViewResolver());
	return registration;
}
 
Example 5
Source Project: java-technology-stack   Source File: ViewResolverRegistryTests.java    License: MIT License 5 votes vote down vote up
@Before
public void setup() {
	StaticWebApplicationContext context = new StaticWebApplicationContext();
	context.registerSingleton("freeMarkerConfigurer", FreeMarkerConfigurer.class);
	context.registerSingleton("tilesConfigurer", TilesConfigurer.class);
	context.registerSingleton("groovyMarkupConfigurer", GroovyMarkupConfigurer.class);
	context.registerSingleton("scriptTemplateConfigurer", ScriptTemplateConfigurer.class);

	this.registry = new ViewResolverRegistry(new ContentNegotiationManager(), context);
}
 
Example 6
Source Project: lams   Source File: ViewResolverRegistry.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Register Tiles 3.x view resolver.
 * <p><strong>Note</strong> that you must also configure Tiles by adding a
 * {@link org.springframework.web.servlet.view.tiles3.TilesConfigurer} bean.
 */
public UrlBasedViewResolverRegistration tiles() {
	if (!checkBeanOfType(TilesConfigurer.class)) {
		throw new BeanInitializationException("In addition to a Tiles view resolver " +
				"there must also be a single TilesConfigurer bean in this web application context " +
				"(or its parent).");
	}
	TilesRegistration registration = new TilesRegistration();
	this.viewResolvers.add(registration.getViewResolver());
	return registration;
}
 
Example 7
/**
 * Register Tiles 3.x view resolver.
 *
 * <p><strong>Note</strong> that you must also configure Tiles by adding a
 * {@link org.springframework.web.servlet.view.tiles3.TilesConfigurer} bean.
 */
public UrlBasedViewResolverRegistration tiles() {
	if (this.applicationContext != null && !hasBeanOfType(TilesConfigurer.class)) {
		throw new BeanInitializationException("In addition to a Tiles view resolver " +
				"there must also be a single TilesConfigurer bean in this web application context " +
				"(or its parent).");
	}
	TilesRegistration registration = new TilesRegistration();
	this.viewResolvers.add(registration.getViewResolver());
	return registration;
}
 
Example 8
@Before
public void setUp() {
	StaticWebApplicationContext context = new StaticWebApplicationContext();
	context.registerSingleton("freeMarkerConfigurer", FreeMarkerConfigurer.class);
	context.registerSingleton("velocityConfigurer", VelocityConfigurer.class);
	context.registerSingleton("tilesConfigurer", TilesConfigurer.class);
	context.registerSingleton("groovyMarkupConfigurer", GroovyMarkupConfigurer.class);
	context.registerSingleton("scriptTemplateConfigurer", ScriptTemplateConfigurer.class);
	this.registry = new ViewResolverRegistry();
	this.registry.setApplicationContext(context);
	this.registry.setContentNegotiationManager(new ContentNegotiationManager());
}
 
Example 9
/**
 * Initialise Tiles on application startup and identify the location of the tiles configuration file, tiles.xml.
 * 
 * @return tiles configurer
 */
@Bean
public TilesConfigurer tilesConfigurer() {
    final TilesConfigurer configurer = new TilesConfigurer();
    configurer.setDefinitions(new String[] { "WEB-INF/tiles/tiles.xml" });
    configurer.setCheckRefresh(true);
    return configurer;
}
 
Example 10
/**
    * Configure tiles using a filesystem location for the configuration file rather than a
    * URL based location.
    * 
    * @return tiles configurer
    */
@Bean
public TilesConfigurer tilesConfigurer() {
	TilesConfigurer configurer = new TilesConfigurer();
	configurer.setDefinitions(new String[] { "file:src/main/webapp/WEB-INF/tiles/tiles.xml" });
	configurer.setCheckRefresh(true);
	return configurer;
}
 
Example 11
@Bean
public TilesConfigurer tilesConfigurer() {
	TilesConfigurer configurer = new TilesConfigurer();
	configurer.setDefinitions("/WEB-INF/tiles.xml");
	return configurer;
}
 
Example 12
Source Project: spring-analysis-note   Source File: JavaConfigTests.java    License: MIT License 4 votes vote down vote up
@Bean
public TilesConfigurer tilesConfigurer() {
	TilesConfigurer configurer = new TilesConfigurer();
	configurer.setDefinitions("/WEB-INF/**/tiles.xml");
	return configurer;
}
 
Example 13
@Bean
public TilesConfigurer tilesConfigurer() {
	TilesConfigurer configurer = new TilesConfigurer();
	configurer.setDefinitions("/WEB-INF/tiles.xml");
	return configurer;
}
 
Example 14
Source Project: java-technology-stack   Source File: JavaConfigTests.java    License: MIT License 4 votes vote down vote up
@Bean
public TilesConfigurer tilesConfigurer() {
	TilesConfigurer configurer = new TilesConfigurer();
	configurer.setDefinitions("/WEB-INF/**/tiles.xml");
	return configurer;
}
 
Example 15
@Bean
public TilesConfigurer tilesConfigurer() {
	TilesConfigurer configurer = new TilesConfigurer();
	configurer.setDefinitions("/WEB-INF/tiles.xml");
	return configurer;
}
 
Example 16
Source Project: spring4-understanding   Source File: JavaConfigTests.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public TilesConfigurer tilesConfigurer() {
	TilesConfigurer configurer = new TilesConfigurer();
	configurer.setDefinitions("/WEB-INF/**/tiles.xml");
	return configurer;
}
 
Example 17
Source Project: spring4-sandbox   Source File: WebConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public TilesConfigurer tilesConfiguer() {
	TilesConfigurer config=new TilesConfigurer();
	config.setDefinitions("/WEB-INF/tiles/definitions.xml");
	return config;	
}