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
e0d68299
Commit
e0d68299
authored
May 02, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新xss
parent
a3dd67c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
14 deletions
+2
-14
README.md
+1
-0
src/main/java/com/stylefeng/guns/core/util/xss/XssFilter.java
+1
-14
No files found.
README.md
View file @
e0d68299
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
4.
对常用js插件进行二次封装,使js代码变得简洁,更加易维护,具体请见webapp/static/js/common文件夹内js代码。
4.
对常用js插件进行二次封装,使js代码变得简洁,更加易维护,具体请见webapp/static/js/common文件夹内js代码。
5.
利用ehcache框架对经常调用的查询进行缓存,提升运行速度,具体请见ConstantFactory类中@Cacheable标记的方法。
5.
利用ehcache框架对经常调用的查询进行缓存,提升运行速度,具体请见ConstantFactory类中@Cacheable标记的方法。
6.
controller层采用map + warpper方式的返回结果,返回给前端更为灵活的数据,具体参见com.stylefeng.guns.modular.system.warpper包中具体类。
6.
controller层采用map + warpper方式的返回结果,返回给前端更为灵活的数据,具体参见com.stylefeng.guns.modular.system.warpper包中具体类。
7.
防止XSS攻击,通过XssFilter类对所有的输入的非法字符串进行过滤以及替换。
##零spring xml配置示例
##零spring xml配置示例
以下配置示例仅列出部分spring配置,详情请见com.stylefeng.guns.project.config包中具体的配置类
以下配置示例仅列出部分spring配置,详情请见com.stylefeng.guns.project.config包中具体的配置类
...
...
src/main/java/com/stylefeng/guns/core/util/xss/XssFilter.java
View file @
e0d68299
...
@@ -10,29 +10,17 @@ public class XssFilter implements Filter {
...
@@ -10,29 +10,17 @@ public class XssFilter implements Filter {
FilterConfig
filterConfig
=
null
;
FilterConfig
filterConfig
=
null
;
public
void
init
(
FilterConfig
filterConfig
)
throws
ServletException
{
public
void
init
(
FilterConfig
filterConfig
)
throws
ServletException
{
this
.
filterConfig
=
filterConfig
;
this
.
filterConfig
=
filterConfig
;
}
}
public
void
destroy
()
{
public
void
destroy
()
{
this
.
filterConfig
=
null
;
this
.
filterConfig
=
null
;
}
}
public
void
doFilter
(
ServletRequest
request
,
ServletResponse
response
,
FilterChain
chain
)
throws
IOException
,
ServletException
{
public
void
doFilter
(
ServletRequest
request
,
ServletResponse
response
,
FilterChain
chain
)
throws
IOException
,
ServletException
{
chain
.
doFilter
(
new
XssHttpServletRequestWrapper
(
chain
.
doFilter
(
new
XssHttpServletRequestWrapper
(
(
HttpServletRequest
)
request
),
response
);
(
HttpServletRequest
)
request
),
response
);
}
}
}
}
\ 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