當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。