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

The following examples show how to use org.springframework.web.servlet.view.tiles3.TilesConfigurer. 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 File: ViewResolverRegistryTests.java    From spring-analysis-note with 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 #2
Source File: TestConfigurtaion.java    From spring-boot-web-mvc-tiles3 with Apache License 2.0 5 votes vote down vote up
/**
    * 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 #3
Source File: WebConfig.java    From Project with 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 File: ViewResolverRegistry.java    From java-technology-stack with 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 File: ConfigurationForTiles.java    From spring-boot-web-mvc-tiles3 with Apache License 2.0 5 votes vote down vote up
/**
 * 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 #6
Source File: ViewResolverRegistryTests.java    From java-technology-stack with 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 #7
Source File: ViewResolverRegistry.java    From spring-analysis-note with 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 #8
Source File: ViewResolverRegistry.java    From lams with 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 #9
Source File: ViewResolverRegistry.java    From spring4-understanding with Apache License 2.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 (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 #10
Source File: ViewResolverRegistryTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@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 #11
Source File: JavaConfigTests.java    From java-technology-stack with 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 #12
Source File: WebConfig.java    From spring4-sandbox with 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;	
}
 
Example #13
Source File: JavaConfigTests.java    From spring4-understanding with 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 #14
Source File: ViewResolutionIntegrationTests.java    From spring4-understanding with 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 #15
Source File: ViewResolutionIntegrationTests.java    From java-technology-stack with 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 #16
Source File: JavaConfigTests.java    From spring-analysis-note with 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 #17
Source File: ViewResolutionIntegrationTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Bean
public TilesConfigurer tilesConfigurer() {
	TilesConfigurer configurer = new TilesConfigurer();
	configurer.setDefinitions("/WEB-INF/tiles.xml");
	return configurer;
}