在webwork文档中对拦截包含或排除的方法有如下说明:
抽象的拦截器可以通过指定included/excluded方法列表来实现可选择性
可以设置的参数如下:
- excludeMethods - 被排除的方法
- includeMethods - 被包含的方法
它的示例用法:
<interceptor-ref name="validation"> <param name="excludeMethods">myValidationExcudeMethod</param> </interceptor-ref>
其中值得注意的是,如果要使用此机制,拦截器的实现必须继承 MethodFilterInterceptor 而不是实现 Interceptor 接口,参见 com.opensymphony.xwork.validator.ValidationInterceptor。