自己写拦截器, 要认识下面接口 与 类
com.opensymphony.xwork2.interceptor.Interceptor 接口
这是最重要的接口, 一般不直接使用它.
com.opensymphony.xwork2.interceptor.AbstractInterceptor 抽象类(空实现了Interceptor接口)
自己写拦截器 可继承这个抽象类, 重写intercept()方法. 实现对某个Action的拦截
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor 抽象 类 (继承AbstractInterceptor)
自己写拦截器 可继承这个抽象类, 重写doIntercept()方法. 实现对某个Action的的某个方法的拦截.
excludeMethods(排除哪方法),includeMethods(拦截哪些方法), 多个方法名用豆号隔开.
论坛使用拦截器实现浏览登陆高清视频下载地址: http://u.115.com/file/t9d9a07674
顶一下
(0)
0%
踩一下
(0)
0%

评论加载中....