本文整理匯總了Java中org.thymeleaf.spring4.view.ThymeleafViewResolver.setTemplateEngine方法的典型用法代碼示例。如果您正苦於以下問題:Java ThymeleafViewResolver.setTemplateEngine方法的具體用法?Java ThymeleafViewResolver.setTemplateEngine怎麽用?Java ThymeleafViewResolver.setTemplateEngine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.thymeleaf.spring4.view.ThymeleafViewResolver
的用法示例。
在下文中一共展示了ThymeleafViewResolver.setTemplateEngine方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@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().name());
resolver.setContentType(appendCharset(this.properties.getContentType(),
resolver.getCharacterEncoding()));
resolver.setExcludedViewNames(this.properties.getExcludedViewNames());
resolver.setViewNames(this.properties.getViewNames());
// This resolver acts as a fallback resolver (e.g. like a
// InternalResourceViewResolver) so it needs to have low precedence
resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
resolver.setCache(this.properties.isCache());
return resolver;
}
示例2: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@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().name());
resolver.setContentType(appendCharset(this.properties.getContentType(),
resolver.getCharacterEncoding()));
resolver.setExcludedViewNames(this.properties.getExcludedViewNames());
resolver.setViewNames(this.properties.getViewNames());
// This resolver acts as a fallback resolver (e.g. like a
// InternalResourceViewResolver) so it needs to have low precedence
resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
return resolver;
}
示例3: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine);
resolver.setCharacterEncoding("UTF-8");
resolver.setCache(false);
resolver.setOrder(1);
return resolver;
}
示例4: viewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
public ViewResolver viewResolver() {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setCharacterEncoding("UTF-8");
resolver.setOrder(1);
return resolver;
}
示例5: viewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine);
resolver.setCharacterEncoding("UTF-8");
resolver.setCache(false);
resolver.setOrder(1);
return resolver;
}
示例6: viewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
public ViewResolver viewResolver() {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setCharacterEncoding("UTF-8");
return resolver;
}
示例7: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
@ConditionalOnMissingBean(name = "thymeleafViewResolver")
@ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true)
public ThymeleafViewResolver thymeleafViewResolver() {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(this.engine);
resolver.setCharacterEncoding("UTF-8");
resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
resolver.setCache(true);
return resolver;
}
示例8: getViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
public ViewResolver getViewResolver(TemplateEngine templateEngine) {
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(templateEngine);
viewResolver.setCharacterEncoding("UTF-8");
return viewResolver;
}
示例9: viewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
public ViewResolver viewResolver() {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setOrder(1);
resolver.setCache(true);
resolver.setCharacterEncoding("UTF-8");
return resolver;
}
示例10: viewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
public ThymeleafViewResolver viewResolver() {
ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver();
thymeleafViewResolver.setTemplateEngine(templateEngine());
thymeleafViewResolver.setCharacterEncoding("UTF-8");
return thymeleafViewResolver;
}
示例11: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@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;
}
示例12: xmlThymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@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;
}
示例13: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
public ThymeleafViewResolver thymeleafViewResolver() {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setCharacterEncoding("UTF-8");
return resolver;
}
示例14: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
@Bean
public ThymeleafViewResolver thymeleafViewResolver(SpringTemplateEngine templateEngine) {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine);
resolver.setCharacterEncoding("UTF-8");
return resolver;
}
示例15: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //導入方法依賴的package包/類
/**
* Handles all views. This view resolver will be executed as first one by Spring.
*/
@Bean
public ViewResolver thymeleafViewResolver() {
ThymeleafViewResolver vr = new ThymeleafViewResolver();
vr.setTemplateEngine(templateEngine());
vr.setCharacterEncoding("UTF-8");
vr.setOrder(Ordered.HIGHEST_PRECEDENCE);
return vr;
}