org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer Java Examples

The following examples show how to use org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer. 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: ViewResolverRegistry.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Register a Groovy markup view resolver with an empty default view name
 * prefix and a default suffix of ".tpl".
 */
public UrlBasedViewResolverRegistration groovy() {
	if (!checkBeanOfType(GroovyMarkupConfigurer.class)) {
		throw new BeanInitializationException("In addition to a Groovy markup view resolver " +
				"there must also be a single GroovyMarkupConfig bean in this web application context " +
				"(or its parent): GroovyMarkupConfigurer is the usual implementation. " +
				"This bean may be given any name.");
	}
	GroovyMarkupRegistration registration = new GroovyMarkupRegistration();
	this.viewResolvers.add(registration.getViewResolver());
	return registration;
}
 
Example #2
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 #3
Source File: ViewResolverRegistry.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Register a Groovy markup view resolver with an empty default view name
 * prefix and a default suffix of ".tpl".
 */
public UrlBasedViewResolverRegistration groovy() {
	if (!checkBeanOfType(GroovyMarkupConfigurer.class)) {
		throw new BeanInitializationException("In addition to a Groovy markup view resolver " +
				"there must also be a single GroovyMarkupConfig bean in this web application context " +
				"(or its parent): GroovyMarkupConfigurer is the usual implementation. " +
				"This bean may be given any name.");
	}
	GroovyMarkupRegistration registration = new GroovyMarkupRegistration();
	this.viewResolvers.add(registration.getViewResolver());
	return registration;
}
 
Example #4
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 #5
Source File: ViewResolverRegistry.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Register a Groovy markup view resolver with an empty default view name
 * prefix and a default suffix of ".tpl".
 */
public UrlBasedViewResolverRegistration groovy() {
	if (!checkBeanOfType(GroovyMarkupConfigurer.class)) {
		throw new BeanInitializationException("In addition to a Groovy markup view resolver " +
				"there must also be a single GroovyMarkupConfig bean in this web application context " +
				"(or its parent): GroovyMarkupConfigurer is the usual implementation. " +
				"This bean may be given any name.");
	}
	GroovyMarkupRegistration registration = new GroovyMarkupRegistration();
	this.viewResolvers.add(registration.getViewResolver());
	return registration;
}
 
Example #6
Source File: ViewResolverRegistry.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Register a Groovy markup view resolver with an empty default view name
 * prefix and a default suffix of ".tpl".
 */
public UrlBasedViewResolverRegistration groovy() {
	if (this.applicationContext != null && !hasBeanOfType(GroovyMarkupConfigurer.class)) {
		throw new BeanInitializationException("In addition to a Groovy markup view resolver " +
				"there must also be a single GroovyMarkupConfig bean in this web application context " +
				"(or its parent): GroovyMarkupConfigurer is the usual implementation. " +
				"This bean may be given any name.");
	}
	GroovyMarkupRegistration registration = new GroovyMarkupRegistration();
	this.viewResolvers.add(registration.getViewResolver());
	return registration;
}
 
Example #7
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 #8
Source File: ViewResolutionIntegrationTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
	GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
	configurer.setResourceLoaderPath("/WEB-INF/");
	return configurer;
}
 
Example #9
Source File: ViewResolutionIntegrationTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
	GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
	configurer.setResourceLoaderPath("/WEB-INF/");
	return configurer;
}
 
Example #10
Source File: GroovyConfiguration.java    From apm-agent-java with Apache License 2.0 4 votes vote down vote up
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
    GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
    configurer.setResourceLoaderPath("/groovy/");
    return configurer;
}
 
Example #11
Source File: ViewResolutionIntegrationTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
	GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
	configurer.setResourceLoaderPath("/WEB-INF/");
	return configurer;
}
 
Example #12
Source File: GroovyConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
    GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
    configurer.setResourceLoaderPath("/WEB-INF/views/");
    return configurer;
}