类org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer源码实例Demo

下面列出了怎么用org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer的API类实例代码及写法,或者点击链接到github查看源代码。

/**
 * 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;
}
 
@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);
}
 
/**
 * 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;
}
 
@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);
}
 
源代码5 项目: lams   文件: ViewResolverRegistry.java
/**
 * 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;
}
 
/**
 * 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;
}
 
@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());
}
 
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
	GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
	configurer.setResourceLoaderPath("/WEB-INF/");
	return configurer;
}
 
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
	GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
	configurer.setResourceLoaderPath("/WEB-INF/");
	return configurer;
}
 
源代码10 项目: apm-agent-java   文件: GroovyConfiguration.java
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
    GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
    configurer.setResourceLoaderPath("/groovy/");
    return configurer;
}
 
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
	GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
	configurer.setResourceLoaderPath("/WEB-INF/");
	return configurer;
}
 
源代码12 项目: tutorials   文件: GroovyConfiguration.java
@Bean
public GroovyMarkupConfigurer groovyMarkupConfigurer() {
    GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer();
    configurer.setResourceLoaderPath("/WEB-INF/views/");
    return configurer;
}
 
 同包方法