Java Code Examples for org.thymeleaf.spring4.view.ThymeleafViewResolver#setExcludedViewNames()

The following examples show how to use org.thymeleaf.spring4.view.ThymeleafViewResolver#setExcludedViewNames() . 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: ThymeleafConfig.java    From portal-de-servicos with MIT License 5 votes vote down vote up
@Bean
public ThymeleafViewResolver thymeleafViewResolver(SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setContentType(TEXT_HTML_VALUE);
    resolver.setExcludedViewNames(new String[]{"*.xml"});
    return resolver;
}
 
Example 2
Source File: ThymeleafConfig.java    From portal-de-servicos with MIT License 5 votes vote down vote up
@Bean
public ThymeleafViewResolver xmlThymeleafViewResolver(SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setContentType(APPLICATION_XML_VALUE);
    resolver.setExcludedViewNames(new String[]{"*.html"});
    return resolver;
}
 
Example 3
Source File: ThymleafConfiguration.java    From onboard with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(name = "thymeleafViewResolver")
@ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true)
public ThymeleafViewResolver thymeleafViewResolver() {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(this.templateEngine);
    resolver.setCharacterEncoding(this.properties.getEncoding());
    resolver.setContentType(appendCharset(this.properties.getContentType(), resolver.getCharacterEncoding()));
    resolver.setExcludedViewNames(this.properties.getExcludedViewNames());
    resolver.setViewNames(this.properties.getViewNames());
    setStaticVariables(resolver);
    resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
    return resolver;
}