com.lwl.anno
注释类型 @WebFilterSort
需要用的jar包 http://download.csdn.net/detail/u013202238/9431110
用该注解注册的Filter默认在部署描述符中的过滤器加载后加载,可以使用isMatchAfter更改加载顺序
为Filter排序注解,排序从1开始,1优先级最高
以url-pattern 过滤的最先执行,以servlet-name 过滤的在全部url-pattern执行后执行
在web.xml中设置参数
< context-param>
< description>被扫描的过滤器的所在包< /description>
< param-name>filterPackage< /param-name>
< param-value>com.test.filter.pack< /param-value>
< /context-param>
filterPackage 必填,包范围越小越好
filterInitScanJar 选填
是否扫描jar包中的类,默认为false不扫描,如果不打印可以不配置该参数
filterInitDebug 选填
是否打印过滤器初始化信息(按排序顺序),默认false不打印,如果不打印可以不配置该参数
为Filter排序注解,排序从1开始,1优先级最高
以url-pattern 过滤的最先执行,以servlet-name 过滤的在全部url-pattern执行后执行
在web.xml中设置参数
< context-param>
< description>被扫描的过滤器的所在包< /description>
< param-name>filterPackage< /param-name>
< param-value>com.test.filter.pack< /param-value>
< /context-param>
filterPackage 必填,包范围越小越好
filterInitScanJar 选填
是否扫描jar包中的类,默认为false不扫描,如果不打印可以不配置该参数
filterInitDebug 选填
是否打印过滤器初始化信息(按排序顺序),默认false不打印,如果不打印可以不配置该参数
-
-
必需元素概要
所需元素 限定符和类型 必需的元素和说明 int
value
排序优先级
-
可选元素概要
可选元素 限定符和类型 可选元素和说明 boolean
asyncSupported
Declares whether the filter supports asynchronous operation mode.DispatcherType[]
dispatcherTypes
The dispatcher types to which the filter applies
default {DispatcherType.REQUEST};java.lang.String
displayName
The display name of the filter,default ""java.lang.String
filterName
The name of the filter,default ""boolean
isMatchAfter
表示该过滤器相对于部署描述符中过滤器的顺序
如果使用的参数为false,那么该过滤器映射将在部署描述符中描述的所有过滤器加载前进行加载,
如果为true( 默认 ),那么部署描述符中的过滤器将先被加载java.lang.String[]
servletNames
The names of the servlets to which the filter applies.java.lang.String[]
urlPatterns
The URL patterns to which the filter applies,default {"/*"}
-
-
-
元素详细资料
-
value
public abstract int value
排序优先级
-
isMatchAfter
public abstract boolean isMatchAfter
表示该过滤器相对于部署描述符中过滤器的顺序
如果使用的参数为false,那么该过滤器映射将在部署描述符中描述的所有过滤器加载前进行加载,
如果为true( 默认 ),那么部署描述符中的过滤器将先被加载- 默认值:
- true
-
displayName
public abstract java.lang.String displayName
The display name of the filter,default ""- 默认值:
- ""
-
filterName
public abstract java.lang.String filterName
The name of the filter,default ""- 默认值:
- ""
-
servletNames
public abstract java.lang.String[] servletNames
The names of the servlets to which the filter applies.,default {}- 默认值:
- {}
-
urlPatterns
public abstract java.lang.String[] urlPatterns
The URL patterns to which the filter applies,default {"/*"}- 默认值:
- "/*"
-
dispatcherTypes
public abstract DispatcherType[] dispatcherTypes
The dispatcher types to which the filter applies
default {DispatcherType.REQUEST};- 默认值:
- <error>
-
asyncSupported
public abstract boolean asyncSupported
Declares whether the filter supports asynchronous operation mode.
default false- 另请参阅:
-
javax.servlet.ServletRequest#startAsync
,javax.servlet.ServletRequest#startAsync(ServletRequest, ServletResponse)
- 默认值:
- false
-
-