提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.data.common.xss; |
H |
2 |
|
|
3 |
import javax.servlet.*; |
|
4 |
import javax.servlet.http.HttpServletRequest; |
|
5 |
import java.io.IOException; |
|
6 |
|
|
7 |
/** |
|
8 |
* XSS过滤 |
|
9 |
* |
|
10 |
* @author Mark sunlightcs@gmail.com |
|
11 |
*/ |
|
12 |
public class XssFilter implements Filter { |
|
13 |
|
|
14 |
@Override |
|
15 |
public void init(FilterConfig config) throws ServletException { |
|
16 |
} |
|
17 |
|
|
18 |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
|
19 |
throws IOException, ServletException { |
|
20 |
XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( |
|
21 |
(HttpServletRequest) request); |
|
22 |
chain.doFilter(xssRequest, response); |
|
23 |
} |
|
24 |
|
|
25 |
@Override |
|
26 |
public void destroy() { |
|
27 |
} |
|
28 |
|
|
29 |
} |