Java Code Examples for org.springframework.web.servlet.view.InternalResourceViewResolver#setRequestContextAttribute()

The following examples show how to use org.springframework.web.servlet.view.InternalResourceViewResolver#setRequestContextAttribute() . 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: WebConfig.java    From Spring with Apache License 2.0 5 votes vote down vote up
@Bean
public InternalResourceViewResolver getViewResolver(){
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/WEB-INF/");
    resolver.setSuffix(".jsp" );
    resolver.setRequestContextAttribute("requestContext");
    return resolver;
}
 
Example 2
Source File: WebConfig.java    From Spring with Apache License 2.0 5 votes vote down vote up
@Bean
InternalResourceViewResolver getViewResolver(){
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/WEB-INF/");
    resolver.setSuffix(".jsp" );
    resolver.setRequestContextAttribute("requestContext");
    return resolver;
}
 
Example 3
Source File: WebConfig.java    From Spring with Apache License 2.0 5 votes vote down vote up
@Bean
InternalResourceViewResolver getViewResolver(){
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/WEB-INF/");
    resolver.setSuffix(".jsp" );
    resolver.setRequestContextAttribute("requestContext");
    return resolver;
}
 
Example 4
Source File: WebMvcConfig.java    From spring-comparing-template-engines with Apache License 2.0 5 votes vote down vote up
@Bean
public ViewResolver chunkViewResolver() {
	InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
	viewResolver.setViewClass(ChunkTemplateView.class);
	viewResolver.setPrefix("/WEB-INF/chunk/");
	viewResolver.setViewNames("*-chunk");
	viewResolver.setSuffix(".chtml");
	viewResolver.setCache(false);
	viewResolver.setRequestContextAttribute("rc");
	viewResolver.setContentType("text/html;charset=UTF-8");

	return viewResolver;
}
 
Example 5
Source File: WebMvcConfig.java    From spring-comparing-template-engines with Apache License 2.0 5 votes vote down vote up
@Bean
public ViewResolver jspViewResolver() {
	InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
	viewResolver.setViewClass(JstlView.class);
	viewResolver.setPrefix("/WEB-INF/jsp/");
	viewResolver.setViewNames("*-jsp");
	viewResolver.setSuffix(".jsp");
	viewResolver.setCache(false);
	viewResolver.setRequestContextAttribute("rc");

	return viewResolver;
}