Search in sources :

Example 1 with ArticleRssFeedViewResolver

use of com.baeldung.spring.controller.rss.ArticleRssFeedViewResolver in project tutorials by eugenp.

the class ApplicationConfiguration method viewResolver.

@Bean
public ContentNegotiatingViewResolver viewResolver(ContentNegotiationManager cnManager) {
    ContentNegotiatingViewResolver cnvResolver = new ContentNegotiatingViewResolver();
    cnvResolver.setContentNegotiationManager(cnManager);
    List<ViewResolver> resolvers = new ArrayList<>();
    InternalResourceViewResolver bean = new InternalResourceViewResolver("/WEB-INF/views/", ".jsp");
    ArticleRssFeedViewResolver articleRssFeedViewResolver = new ArticleRssFeedViewResolver();
    resolvers.add(bean);
    resolvers.add(articleRssFeedViewResolver);
    cnvResolver.setViewResolvers(resolvers);
    return cnvResolver;
}
Also used : ArrayList(java.util.ArrayList) ContentNegotiatingViewResolver(org.springframework.web.servlet.view.ContentNegotiatingViewResolver) ViewResolver(org.springframework.web.servlet.ViewResolver) ArticleRssFeedViewResolver(com.baeldung.spring.controller.rss.ArticleRssFeedViewResolver) InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver) ContentNegotiatingViewResolver(org.springframework.web.servlet.view.ContentNegotiatingViewResolver) ArticleRssFeedViewResolver(com.baeldung.spring.controller.rss.ArticleRssFeedViewResolver) InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver) Bean(org.springframework.context.annotation.Bean)

Aggregations

ArticleRssFeedViewResolver (com.baeldung.spring.controller.rss.ArticleRssFeedViewResolver)1 ArrayList (java.util.ArrayList)1 Bean (org.springframework.context.annotation.Bean)1 ViewResolver (org.springframework.web.servlet.ViewResolver)1 ContentNegotiatingViewResolver (org.springframework.web.servlet.view.ContentNegotiatingViewResolver)1 InternalResourceViewResolver (org.springframework.web.servlet.view.InternalResourceViewResolver)1