本文整理汇总了Java中nz.net.ultraq.thymeleaf.LayoutDialect类的典型用法代码示例。如果您正苦于以下问题:Java LayoutDialect类的具体用法?Java LayoutDialect怎么用?Java LayoutDialect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutDialect类属于nz.net.ultraq.thymeleaf包,在下文中一共展示了LayoutDialect类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import nz.net.ultraq.thymeleaf.LayoutDialect; //导入依赖的package包/类
/**
* Configures engine and template resolving.
*/
@Override
public void init(@SuppressWarnings("rawtypes") NamedList args) {
checkNotNull(args);
this.configuration = SolrParams.toSolrParams(args);
// configure template resolver
templateResolver = new TemplateResolver();
templateResolver.setResourceResolver(resourceResolver);
templateResolver.setCharacterEncoding("utf-8");
templateResolver.setTemplateMode(configuration.get("tl.templateMode", "XHTML"));
templateResolver.setSuffix(configuration.get("tl.suffix", ".html"));
if (configuration.get("tl.cacheTtlMs") != null) {
templateResolver.setCacheTTLMs(Long.parseLong(configuration.get("tl.cacheTTLMs")));
} else {
templateResolver.setCacheTTLMs(TimeUnit.HOURS.toMillis(1l));
}
if (configuration.get("tl.locale") != null) {
locale = Locale.forLanguageTag(configuration.get("tl.locale"));
}
layoutDialect = new LayoutDialect();
}
开发者ID:shopping24,项目名称:solr-thymeleaf,代码行数:28,代码来源:ThymeleafResponseWriter.java
示例2: createThymeleaf
import nz.net.ultraq.thymeleaf.LayoutDialect; //导入依赖的package包/类
@Bean
public ThymeleafTemplateEngine createThymeleaf() {
boolean cachingEnabled = env.getProperty("jbakery.thymeleaf.cachingEnabled", Boolean.class, false);
TemplateResolver templateResolver = new TemplateResolver();
templateResolver.setResourceResolver(new FileResourceResolver());
templateResolver.setPrefix("templates/");
templateResolver.setTemplateMode("HTML5");
templateResolver.setSuffix(".html");
templateResolver.setCacheable(cachingEnabled);
templateResolver.addTemplateAlias("", "/index");
templateResolver.addTemplateAlias("/", "/index");
ThymeleafTemplateEngine engine = ThymeleafTemplateEngine.create()
.setMode(StandardTemplateModeHandlers.HTML5.getTemplateModeName());
// enable layout
engine.getThymeleafTemplateEngine().addDialect(new LayoutDialect());
engine.getThymeleafTemplateEngine().setTemplateResolver(templateResolver);
return engine;
}
开发者ID:netdava,项目名称:jbakery,代码行数:23,代码来源:Config.java
示例3: getTemplateEngine
import nz.net.ultraq.thymeleaf.LayoutDialect; //导入依赖的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
示例4: templateEngine
import nz.net.ultraq.thymeleaf.LayoutDialect; //导入依赖的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
示例5: templateEngine
import nz.net.ultraq.thymeleaf.LayoutDialect; //导入依赖的package包/类
@Bean
public SpringTemplateEngine templateEngine(final ServletContextTemplateResolver templateResolver) {
SpringTemplateEngine engine = new SpringTemplateEngine();
engine.setTemplateResolver(templateResolver);
// engine.setEnableSpringELCompiler(true);
engine.setAdditionalDialects(new HashSet<IDialect>() {{
add(new LayoutDialect());
add(new SpringSecurityDialect());
}});
return engine;
}
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:13,代码来源:ThymeleafConfig.java
示例6: templateEngine
import nz.net.ultraq.thymeleaf.LayoutDialect; //导入依赖的package包/类
@Bean
public SpringTemplateEngine templateEngine() {
SpringTemplateEngine engine = new SpringTemplateEngine();
engine.setEnableSpringELCompiler(true);
engine.addDialect(new LayoutDialect());
engine.addDialect(java8TimeDialect());
engine.addDialect(new SpringSecurityDialect());
engine.addDialect(new KonkerDialect());
engine.setTemplateResolver(templateResolver());
return engine;
}
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:12,代码来源:WebMvcConfig.java
示例7: layoutDialectCanBeCustomized
import nz.net.ultraq.thymeleaf.LayoutDialect; //导入依赖的package包/类
@Test
public void layoutDialectCanBeCustomized() throws Exception {
this.context.register(LayoutDialectConfiguration.class);
this.context.refresh();
LayoutDialect layoutDialect = this.context.getBean(LayoutDialect.class);
assertThat(ReflectionTestUtils.getField(layoutDialect, "sortingStrategy"))
.isInstanceOf(GroupingStrategy.class);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:ThymeleafAutoConfigurationTests.java
注:本文中的nz.net.ultraq.thymeleaf.LayoutDialect类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论