当前位置: 首页>>代码示例>>Java>>正文


Java ThymeleafViewResolver.setCharacterEncoding方法代码示例

本文整理汇总了Java中org.thymeleaf.spring4.view.ThymeleafViewResolver.setCharacterEncoding方法的典型用法代码示例。如果您正苦于以下问题:Java ThymeleafViewResolver.setCharacterEncoding方法的具体用法?Java ThymeleafViewResolver.setCharacterEncoding怎么用?Java ThymeleafViewResolver.setCharacterEncoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.thymeleaf.spring4.view.ThymeleafViewResolver的用法示例。


在下文中一共展示了ThymeleafViewResolver.setCharacterEncoding方法的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;
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:18,代码来源:ThymeleafAutoConfiguration.java

示例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;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:17,代码来源:ThymeleafAutoConfiguration.java

示例4: 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;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:11,代码来源:ThymeleafConfig.java

示例5: 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;
}
 
开发者ID:linkedin,项目名称:custom-gradle-plugin-portal,代码行数:8,代码来源:ResourceConfig.java

示例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;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:11,代码来源:ThymeleafConfig.java

示例7: xmlViewResolver

import org.thymeleaf.spring4.view.ThymeleafViewResolver; //导入方法依赖的package包/类
@Bean
public ViewResolver xmlViewResolver() {
	SpringTemplateEngine engine = xmlTemplateEngine();
	ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
	viewResolver.setTemplateEngine(engine);
	viewResolver.setCharacterEncoding("UTF-8"); // Questo è importante anche se nei tutorial non lo mettono
	viewResolver.setOrder(10);
	// Tutti i template devono stare nel folder /xml. Se non si usa un folder specifico, questo viewResolver non viene usato
	viewResolver.setViewNames(new String[] { "/xml/*" }); // E' giusto mettere "*" e non "*.xml" perchè il suffisso viene attaccato grazie al resolver.setSuffix(".xml") di xmlTemplateResolver()
	viewResolver.setContentType("text/xml");
	// Default is "true": caching is enabled. Disable this only for debugging and development.
	viewResolver.setCache(config.isProductionEnvironment()); 
	return viewResolver;
}
 
开发者ID:xtianus,项目名称:yadaframework,代码行数:15,代码来源:YadaWebConfig.java

示例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;
}
 
开发者ID:bobxwang,项目名称:springboot-scala-withswagger,代码行数:12,代码来源:Thymeleaf3Config.java

示例9: 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;
}
 
开发者ID:gravitee-io,项目名称:graviteeio-access-management,代码行数:8,代码来源:ThymeleafConfiguration.java

示例10: 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;
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:10,代码来源:WebMvcConfig.java

示例11: 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;
}
 
开发者ID:swri-robotics,项目名称:bag-database,代码行数:8,代码来源:WebMvcConfig.java

示例12: 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;
}
 
开发者ID:servicosgovbr,项目名称:portal-de-servicos,代码行数:10,代码来源:ThymeleafConfig.java

示例13: 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;
}
 
开发者ID:servicosgovbr,项目名称:portal-de-servicos,代码行数:10,代码来源:ThymeleafConfig.java

示例14: 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;
}
 
开发者ID:macielbombonato,项目名称:apolo,代码行数:8,代码来源:ThymeleafConfig.java

示例15: 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;
}
 
开发者ID:astrohome,项目名称:photogallery,代码行数:8,代码来源:WebMvcConfig.java


注:本文中的org.thymeleaf.spring4.view.ThymeleafViewResolver.setCharacterEncoding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。