SpringBoot集成Beetl的简单测试

时间:2021-02-24 09:47:41
【文件属性】:

文件名称:SpringBoot集成Beetl的简单测试

文件大小:19KB

文件格式:ZIP

更新时间:2021-02-24 09:47:41

spring boot beetl

SpringBoot集成Beetl的简单测试 @Configuration public class BeetlConfiguration { @Bean(initMethod = "init", name = "beetlConfig") public BeetlGroupUtilConfiguration getBeetlGroupUtilConfiguration() { BeetlGroupUtilConfiguration beetlGroupUtilConfiguration = new BeetlGroupUtilConfiguration(); ClasspathResourceLoader classpathResourceLoader = new ClasspathResourceLoader(); beetlGroupUtilConfiguration.setResourceLoader(classpathResourceLoader); ResourcePatternResolver patternResolver = ResourcePatternUtils.getResourcePatternResolver(new DefaultResourceLoader()); //读取配置文件信息 beetlGroupUtilConfiguration.setConfigFileResource(patternResolver.getResource("classpath:beetl.properties")); return beetlGroupUtilConfiguration; } @Bean(name = "beetlViewResolver") public BeetlSpringViewResolver getBeetlSpringViewResolver(@Qualifier("beetlConfig") BeetlGroupUtilConfiguration beetlGroupUtilConfiguration) { BeetlSpringViewResolver beetlSpringViewResolver = new BeetlSpringViewResolver(); beetlSpringViewResolver.setPrefix("/templates/"); beetlSpringViewResolver.setSuffix(".html"); beetlSpringViewResolver.setContentType("text/html;charset=UTF-8"); beetlSpringViewResolver.setOrder(0); beetlSpringViewResolver.setConfig(beetlGroupUtilConfiguration); return beetlSpringViewResolver; } }


【文件预览】:
Beetl-SpringBoot
----pom.xml(2KB)
----target()
--------test-classes()
--------classes()
----.settings()
--------org.eclipse.m2e.core.prefs(90B)
--------org.eclipse.wst.common.project.facet.core.xml(145B)
--------org.eclipse.core.resources.prefs(124B)
--------org.eclipse.jdt.core.prefs(243B)
----src()
--------main()
----.project(1KB)
----.classpath(1KB)
----README.md(481B)

网友评论