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

被折叠的 条评论
为什么被折叠?



