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


Java SpringTemplateEngine类代码示例

本文整理汇总了Java中org.thymeleaf.spring4.SpringTemplateEngine的典型用法代码示例。如果您正苦于以下问题:Java SpringTemplateEngine类的具体用法?Java SpringTemplateEngine怎么用?Java SpringTemplateEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SpringTemplateEngine类属于org.thymeleaf.spring4包,在下文中一共展示了SpringTemplateEngine类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: emailTemplateEngine

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的package包/类
@Bean
public TemplateEngine emailTemplateEngine() {
	final SpringTemplateEngine templateEngine = new SpringTemplateEngine();
	templateEngine.addTemplateResolver(htmlTemplateResolver());
	templateEngine.setTemplateEngineMessageSource(messageSource);
	return templateEngine;
}
 
开发者ID:mychalvlcek,项目名称:spring-rest-skeleton,代码行数:8,代码来源:EmailConfiguration.java

示例2: MailService

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的package包/类
public MailService(JHipsterProperties jHipsterProperties, JavaMailSender javaMailSender,
        MessageSource messageSource, SpringTemplateEngine templateEngine) {

    this.jHipsterProperties = jHipsterProperties;
    this.javaMailSender = javaMailSender;
    this.messageSource = messageSource;
    this.templateEngine = templateEngine;
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:9,代码来源:MailService.java

示例3: CasProtocolView

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的package包/类
/**
 * Instantiates a new Cas protocol view.
 *
 * @param templateName       the template name
 * @param applicationContext the application context
 * @param templateEngine     the template engine
 * @param properties         the properties
 */
public CasProtocolView(final String templateName, final ApplicationContext applicationContext,
                       final SpringTemplateEngine templateEngine, final ThymeleafProperties properties) {
    super(templateName);
    setApplicationContext(applicationContext);
    setTemplateEngine(templateEngine);
    setCharacterEncoding(properties.getEncoding().displayName());
    setLocale(Locale.getDefault());
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:17,代码来源:CasProtocolView.java

示例4: templateEngine

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的package包/类
@Bean
public SpringTemplateEngine templateEngine(){
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver());
    engine.setEnableSpringELCompiler(true);
    return engine;
}
 
开发者ID:scrumtracker,项目名称:scrumtracker2017,代码行数:8,代码来源:ThymeleafConfig.java

示例5: templateEngine

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的package包/类
@Bean
public TemplateEngine templateEngine() {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setEnableSpringELCompiler(true);
    engine.setTemplateResolver(templateResolver());
    return engine;
}
 
开发者ID:ArturWisniewski,项目名称:ToDoApp-Spring,代码行数:8,代码来源:ThymeleafConfig.java

示例6: getTemplateEngine

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的package包/类
/**
 * Bean to configure the template engine
 *
 * @return the template engine
 */
@Bean(name = "templateEngine")
public SpringTemplateEngine getTemplateEngine() {
    final SpringTemplateEngine templateEngine = new SpringTemplateEngine();
    final Set<IDialect> dialects = new HashSet<>();
    dialects.add(new LayoutDialect());
    templateEngine.setAdditionalDialects(dialects);
    templateEngine.setTemplateResolver(getTemplateResolver());
    return templateEngine;
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:15,代码来源:TemplateConfig.java

示例7: templateEngine

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的package包/类
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.setTemplateResolver(templateResolver);

    engine.addDialect(new SpringSecurityDialect());
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.afterPropertiesSet();
    return engine;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:13,代码来源:ThymeleafConfig.java

示例8: viewResolver

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的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

示例9: xmlViewResolver

import org.thymeleaf.spring4.SpringTemplateEngine; //导入依赖的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


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