Created
October 13, 2015 02:43
-
-
Save syhily/2cd3d65ef318db8fad26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.servlet.*; | |
import javax.servlet.http.HttpServletRequest; | |
import java.io.IOException; | |
/** | |
* <p>Title: XSS Filter</p> | |
* <p>Description: 描述</p> | |
* | |
* @author yufan.sheng | |
* @version 0.1, 14-5-1 21:43 | |
*/ | |
public class XssFilter implements Filter { | |
private FilterConfig filterConfig = null; | |
public void init(FilterConfig filterConfig) throws ServletException { | |
this.filterConfig = filterConfig; | |
} | |
public void destroy() { | |
this.filterConfig = null; | |
} | |
public void doFilter(ServletRequest request, ServletResponse response, | |
FilterChain chain) throws IOException, ServletException { | |
chain.doFilter(new XssHttpServletRequestWrapper( | |
(HttpServletRequest) request), response); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment