1.加载webapp下的资源需要在pom.xml配置静态资源路径,如下配置加载resources和webapp下的静态资源
<build>
<!-- 加载静态资源-->
<resources>
<resource>
<directory>src/main/webapp</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
2.配置beetl的配置,在application.properties
spring.mvc.view.prefix=/pages
beetl.delimiter-statement-start=@
beetl.delimiter-statement-end=null
beetl.resource-tagroot=common/tags
beetl.resource-tagsuffix=tag
beetl.resource-auto-check=true
3.在java读取properties配置
package com.debug.kill.config.properties;
import com.debug.kill.server.utils.ToolUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* beetl配置(如果需要配置别的配置可参照这个形式自己添加)
*
* @author ...
* @date 2017-05-24 2