Skip to content

Instantly share code, notes, and snippets.

@syhily
Created October 13, 2015 02:43
Show Gist options
  • Save syhily/2cd3d65ef318db8fad26 to your computer and use it in GitHub Desktop.
Save syhily/2cd3d65ef318db8fad26 to your computer and use it in GitHub Desktop.
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