本文整理汇总了Java中org.thymeleaf.spring4.view.ThymeleafViewResolver.setOrder方法的典型用法代码示例。如果您正苦于以下问题:Java ThymeleafViewResolver.setOrder方法的具体用法?Java ThymeleafViewResolver.setOrder怎么用?Java ThymeleafViewResolver.setOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.thymeleaf.spring4.view.ThymeleafViewResolver
的用法示例。
在下文中一共展示了ThymeleafViewResolver.setOrder方法的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();
configureTemplateEngine(resolver, 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;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:18,代码来源:AbstractThymeleafViewResolverConfiguration.java
示例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);
resolver.setCache(this.properties.isCache());
return resolver;
}
示例3: 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;
}
示例4: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //导入方法依赖的package包/类
@Bean
public ThymeleafViewResolver thymeleafViewResolver()
{
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setOrder(1);
resolver.setCharacterEncoding("UTF-8");
return resolver;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例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: 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;
}
示例11: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //导入方法依赖的package包/类
@Bean
public ViewResolver thymeleafViewResolver() {
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(templateEngine());
viewResolver.setOrder(1);
viewResolver.setExcludedViewNames(new String[] { "*.xml" });
return viewResolver;
}
示例12: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //导入方法依赖的package包/类
@Bean
public ThymeleafViewResolver thymeleafViewResolver(WebApplicationContext wac) {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver();
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode("HTML5");
templateResolver.setCharacterEncoding("UTF-8");
templateEngine.setTemplateResolver(templateResolver);
resolver.setTemplateEngine(templateEngine);
resolver.setOrder(2);
resolver.setApplicationContext(wac);
resolver.setCharacterEncoding("UTF-8");
//Enable the Spring Security Thymeleaf integration
templateEngine.addDialect(new LayoutDialect());
// caching
String[] activeProfiles = env.getActiveProfiles();
if (Arrays.asList(activeProfiles).contains("dev")) {
log.info("DEV Profile is active. Disabling template caching.");
templateResolver.setCacheable(false);
templateEngine.setCacheManager(null);
resolver.setCache(false);
}
return resolver;
}
示例13: 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());
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;
}
示例14: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //导入方法依赖的package包/类
@Bean
@ConditionalOnMissingBean(name = "thymeleafViewResolver")
public ThymeleafViewResolver thymeleafViewResolver() {
final ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(this.templateEngine);
resolver.setCharacterEncoding(this.environment.getProperty("encoding", "UTF-8"));
resolver.setContentType(appendCharset(this.environment.getProperty("contentType", "text/html"), resolver.getCharacterEncoding()));
resolver.setExcludedViewNames(this.environment.getProperty("excludedViewNames", String[].class));
resolver.setViewNames(this.environment.getProperty("viewNames", String[].class));
resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
resolver.setCache(this.environment.getProperty("cache", Boolean.class, true));
return resolver;
}
示例15: thymeleafViewResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver; //导入方法依赖的package包/类
@Bean
public ThymeleafViewResolver thymeleafViewResolver() {
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(thymeleafTemplateEngine());
viewResolver.setCharacterEncoding("UTF-8");
viewResolver.setOrder(2);
return viewResolver;
}