gboat2.base.plugin.servlet.filter
类 AntiXssSqlInjectFilter
java.lang.Object
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter
- 所有已实现的接口:
- javax.servlet.Filter
public class AntiXssSqlInjectFilter
- extends Object
- implements javax.servlet.Filter
防止 SQL 注入的监听器。
配置示例:
<filter>
<!-- 过滤需要防止xss、sql攻击的请求 ,此配置统一解决不了的需求,需自己有针对性的过滤 -->
<filter-name>antiXssSqlInjectFilter</filter-name>
<filter-class>gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter</filter-class>
<init-param>
<!-- 以逗号分隔的需要过滤的请求列表,支持通配符 -->
<param-name>xssIncludes</param-name>
<param-value>
/register!registerSave.do,
*/login!login.do,
*/login!rolesBeforeLogin.do
</param-value>
</init-param>
<init-param>
<!-- 以逗号分隔的需要排除的请求列表,支持通配符,优先级高于xssIncludes -->
<param-name>xssExcludes</param-name>
<param-value></param-value>
</init-param>
<init-param>
<param-name>sqlIncludes</param-name>
<param-value>
/register!registerSave.do,
*/login!login.do
</param-value>
</init-param>
<init-param>
<param-name>sqlExcludes</param-name>
<param-value></param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>antiXssSqlInjectFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
- 从以下版本开始:
- 1.0
- 作者:
- tanxw
方法摘要 |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
xssExcludes
protected Set<String> xssExcludes
xssIncludes
protected Set<String> xssIncludes
sqlExcludes
protected Set<String> sqlExcludes
sqlIncludes
protected Set<String> sqlIncludes
AntiXssSqlInjectFilter
public AntiXssSqlInjectFilter()
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- 指定者:
- 接口
javax.servlet.Filter
中的 init
- 抛出:
javax.servlet.ServletException
destroy
public void destroy()
- 指定者:
- 接口
javax.servlet.Filter
中的 destroy
doFilter
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
- 指定者:
- 接口
javax.servlet.Filter
中的 doFilter
- 抛出:
IOException
javax.servlet.ServletException
Copyright © 2014 广联达软件股份有限公司(Glodon Software Co., Ltd.). All rights reserved.