Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
180c094c
Commit
180c094c
authored
May 22, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
把beetl配置放到java配置里
parent
a4eee8a7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
24 deletions
+50
-24
pom.xml
+1
-1
src/main/java/com/stylefeng/guns/config/properties/BeetlProperties.java
+47
-0
src/main/java/com/stylefeng/guns/config/web/WebConfig.java
+2
-2
src/main/resources/beetl.properties
+0
-21
No files found.
pom.xml
View file @
180c094c
...
...
@@ -6,7 +6,7 @@
<groupId>
com.stylefeng
</groupId>
<artifactId>
guns
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<packaging>
j
ar
</packaging>
<packaging>
w
ar
</packaging>
<name>
guns
</name>
<description>
guns 的spring boot版本
</description>
...
...
src/main/java/com/stylefeng/guns/config/properties/BeetlProperties.java
0 → 100644
View file @
180c094c
package
com
.
stylefeng
.
guns
.
config
.
properties
;
import
java.util.Properties
;
/**
* beetl配置
*
* @author fengshuonan
* @date 2017-05-22 18:45
*/
public
class
BeetlProperties
{
private
static
BeetlProperties
beetlProperties
=
new
BeetlProperties
();
private
Properties
properties
=
new
Properties
();
private
BeetlProperties
(){
init
();
}
public
void
init
()
{
//开始结束占位符
this
.
properties
.
setProperty
(
"DELIMITER_PLACEHOLDER_START"
,
"${"
);
this
.
properties
.
setProperty
(
"DELIMITER_PLACEHOLDER_END"
,
"}"
);
//开始结束标签
this
.
properties
.
setProperty
(
"DELIMITER_STATEMENT_START"
,
"@"
);
this
.
properties
.
setProperty
(
"DELIMITER_STATEMENT_END"
,
"null"
);
//classpath 根路径
this
.
properties
.
setProperty
(
"RESOURCE.root"
,
"/WEB-INF/view"
);
//是否检测文件变化
this
.
properties
.
setProperty
(
"RESOURCE.autoCheck"
,
"true"
);
//beetl HTMl标签
this
.
properties
.
setProperty
(
"HTML_TAG_FLAG"
,
"#"
);
//自定义标签文件Root目录和后缀
this
.
properties
.
setProperty
(
"RESOURCE.tagRoot"
,
"common/tags"
);
this
.
properties
.
setProperty
(
"RESOURCE.tagSuffix"
,
"tag"
);
}
public
static
Properties
newInstance
(){
return
beetlProperties
.
properties
;
}
}
src/main/java/com/stylefeng/guns/config/web/WebConfig.java
View file @
180c094c
package
com
.
stylefeng
.
guns
.
config
.
web
;
import
com.alibaba.druid.support.http.StatViewServlet
;
import
com.stylefeng.guns.config.properties.BeetlProperties
;
import
com.stylefeng.guns.core.beetl.BeetlConfiguration
;
import
com.stylefeng.guns.core.listener.ConfigListener
;
import
com.stylefeng.guns.core.util.xss.XssFilter
;
...
...
@@ -10,7 +11,6 @@ import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import
org.springframework.boot.web.servlet.ServletRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.web.context.request.RequestContextListener
;
/**
...
...
@@ -28,7 +28,7 @@ public class WebConfig {
@Bean
(
initMethod
=
"init"
)
public
BeetlConfiguration
beetlConfiguration
()
{
BeetlConfiguration
beetlConfiguration
=
new
BeetlConfiguration
();
beetlConfiguration
.
setConfig
FileResource
(
new
ClassPathResource
(
"beetl.properties"
));
beetlConfiguration
.
setConfig
Properties
(
BeetlProperties
.
newInstance
(
));
return
beetlConfiguration
;
}
...
...
src/main/resources/beetl.properties
deleted
100644 → 0
View file @
a4eee8a7
#开始结束占位符
DELIMITER_PLACEHOLDER_START
=
${
DELIMITER_PLACEHOLDER_END
=
}
#开始结束标签
DELIMITER_STATEMENT_START
=
@
DELIMITER_STATEMENT_END
=
null
#classpath 根路径
RESOURCE.root
=
/WEB-INF/view
#是否检测文件变化
RESOURCE.autoCheck
=
true
#beetl HTMl标签
HTML_TAG_FLAG
=
#
#自定义标签文件Root目录和后缀
RESOURCE.tagRoot
=
common/tags
RESOURCE.tagSuffix
=
tag
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment