Struts2框架10.方法拦截器
来源:互联网 发布:安徽移动网络速度慢 编辑:程序博客网 时间:2024/06/10 23:27
前面说的拦截器,是拦截整个Action的,但是如我们只想拦截Action中的某个方法,那么就需要使用方法拦截器。使用方法拦截器需要继承MethodFilterInterceptor类。代码如下
注意:在配置action元素的时候一定要使用method属性,因为它是通过这个属性进行拦截的。
public class asd extends MethodFilterInterceptor { @Override protected String doIntercept(ActionInvocation actionInvocation) throws Exception { return null; }}struts.xml配置文件中配置方法拦截器
<package name="s" namespace="/" extends="struts-default"> <interceptors> <interceptor name="" class=""> <param name="includeMethods">list</param> </interceptor> </interceptors> <action name="" method=""> </action> </package>有两个参数,一个设置被拦截方法(includeMethods),另一个设置不被拦截方法(excludeMethods),多个方法是用逗号分隔。
注意:在配置action元素的时候一定要使用method属性,因为它是通过这个属性进行拦截的。
0 0
- Struts2框架10.方法拦截器
- 009-Struts2框架拦截器二之方法拦截器
- struts2方法拦截器
- Struts2框架(四)拦截器
- Struts2框架之拦截器
- Struts2 自定义拦截器(方法拦截器)
- Struts2 自定义拦截器(方法拦截器)
- Struts2 自定义拦截器(方法拦截器)
- Struts2 自定义拦截器(方法拦截器)
- Struts2 自定义拦截器(方法拦截器)
- Struts2 自定义拦截器(方法拦截器)
- struts2拦截器(拦截指定方法
- struts2拦截器(拦截指定方法)
- Struts2之方法拦截器
- struts2框架---------拦截器(Interceptor)
- 008-Struts2框架拦截器一
- SSH:Struts2框架(拦截器)
- Struts2框架运行机制(拦截器,struts标签)
- poj 3292 Semi-prime H-numbers(筛法~)
- poj 2976(01分数规划+二分)
- c++ map删除元素的三种方式
- HDU4597:Play Game(记忆化搜索(dp))(博弈)
- hihocoder1363 图像算子
- Struts2框架10.方法拦截器
- webrtc视频引擎之 vedio_capture_module介绍
- 修改VNCSERVER的分辨率
- 关于PHP中复选框CheckBox的数据库存取使用方法总结
- ajax 如何 读取 xml 文档
- Android中多图片选择器PhotoPicker库的使用(仿微信,秒杀MultiImageSelector)自己修改的多选
- 注意点小结(Java)
- RasDeleteSubEntry
- 数据---File