Java Code Examples for org.springframework.web.servlet.view.UrlBasedViewResolver#setViewClass()

The following examples show how to use org.springframework.web.servlet.view.UrlBasedViewResolver#setViewClass() . 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: DispatcherServletConfiguration.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
@Bean
public ViewResolver contentNegotiatingViewResolver() {
    log.debug("Configuring the ContentNegotiatingViewResolver");
    ContentNegotiatingViewResolver viewResolver = new ContentNegotiatingViewResolver();
    List<ViewResolver> viewResolvers = new ArrayList<ViewResolver>();

    UrlBasedViewResolver urlBasedViewResolver = new UrlBasedViewResolver();
    urlBasedViewResolver.setViewClass(JstlView.class);
    urlBasedViewResolver.setPrefix("/WEB-INF/pages/");
    urlBasedViewResolver.setSuffix(".jsp");
    viewResolvers.add(urlBasedViewResolver);

    viewResolver.setViewResolvers(viewResolvers);

    List<View> defaultViews = new ArrayList<View>();
    defaultViews.add(new MappingJackson2JsonView());
    viewResolver.setDefaultViews(defaultViews);

    return viewResolver;
}
 
Example 2
Source File: WebConfig.java    From maven-framework-project with MIT License 5 votes vote down vote up
@Bean
public UrlBasedViewResolver setupViewResolver() {
	UrlBasedViewResolver resolver = new UrlBasedViewResolver();
	resolver.setPrefix("/WEB-INF/pages/");
	resolver.setSuffix(".jsp");
	resolver.setViewClass(JstlView.class);
	return resolver;
}
 
Example 3
Source File: ScopesConfig.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public UrlBasedViewResolver setupViewResolver() {
    final UrlBasedViewResolver resolver = new UrlBasedViewResolver();
    resolver.setPrefix("/WEB-INF/view/");
    resolver.setSuffix(".jsp");
    resolver.setViewClass(JstlView.class);
    return resolver;
}
 
Example 4
Source File: AppConfig.java    From tutorials with MIT License 5 votes vote down vote up
/**
 * View resolver for JSP
 */
@Bean
public UrlBasedViewResolver viewResolver() {
    UrlBasedViewResolver resolver = new UrlBasedViewResolver();
    resolver.setPrefix("/WEB-INF/jsp/");
    resolver.setSuffix(".jsp");
    resolver.setViewClass(JstlView.class);
    return resolver;
}
 
Example 5
Source File: AppConfig.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public UrlBasedViewResolver viewResolver() {
    final UrlBasedViewResolver bean = new UrlBasedViewResolver();
    bean.setPrefix("/WEB-INF/jsp/");
    bean.setSuffix(".jsp");
    bean.setViewClass(JstlView.class);
    return bean;
}
 
Example 6
Source File: AppConfig.java    From tutorials with MIT License 5 votes vote down vote up
/** View resolver for JSP */
@Bean
public UrlBasedViewResolver viewResolver() {
    UrlBasedViewResolver resolver = new UrlBasedViewResolver();
    resolver.setPrefix("/WEB-INF/jsp/");
    resolver.setSuffix(".jsp");
    resolver.setViewClass(JstlView.class);
    return resolver;
}