StrutsPrepareAndExecuteFilter的作用
来源:互联网 发布:淘宝中老年女秋装新款 编辑:程序博客网 时间:2024/05/04 14:36
文章来源:http://blog.sina.com.cn/s/blog_6ac4c6cb010190ml.html
FilterDispatcher是早期struts2的过滤器,后期的都用StrutsPrepareAndExecuteF
FilterDispatcher是struts2.0.x到2.1.2版本的核心过滤器.!
StrutsPrepareAndExecuteF
这样的改革当然是有好处的.!
为什么这么说.? 应该知道如果我们自己定义过滤器的话, 是要放在strtus2的过滤器之前的, 如果放在struts2过滤器之后,你自己的过滤器对action的过滤作用就废了,不会有效!除非你是访问jsp/html!
那我现在有需求, 我必须使用Action的环境,而又想在执行action之前拿filter做一些事, 用FilterDispatcher是做不到的.!
那么StrutsPrepareAndExecuteF
给你打个比喻, 现在有病人要做手术, 现在struts2要做两件事, 搭病床(环境),执行手术.! 那么打麻药的工作呢.? 不可能要病人站着打吧, 所以必须有病床的环境,打完麻药之后再动手术.! 这个比喻非常形象了.!
如果是2.1.3之前的版本,用org.apache.struts2.dispatcher.FilterDispatcher,
否则,用org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteF
三个初始化参数:
</filter>
<filter-mapping>
</filter-mapping>
如果程序报类找不到异常,且后面有
等信息,可能是你的版本问题.解决方法是确定你的struts版本,如果是2.1.3之前的版本,用 org.apache.struts2.dispatcher.FilterDispatcher,以后的版本则配置org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteF
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用
- StrutsPrepareAndExecuteFilter的作用 Struts
- StrutsPrepareAndExecuteFilter的作用,和FilterDispatcher区别
- FilterDispatcher和StrutsPrepareAndExecuteFilter的作用及应用
- struts2 StrutsPrepareAndExecuteFilter作用及配置
- struts2的StrutsPrepareAndExecuteFilter
- StrutsPrepareAndExecuteFilter
- BZOJ 3052 [wc2013]糖果公园 树上莫队
- Android性能优化
- Objective-C Runtime 运行时之三:方法与消息
- Android Service组件
- Android网络请求工具类
- StrutsPrepareAndExecuteFilter的作用
- Android之meta-data使用
- thinkphp实例化模型Model
- 【屌丝程序的口才逆袭演讲稿50篇】第十二篇:世界上最快的捷径【张振华.Jack】
- Android 为什么计算不出准确的屏幕尺寸的原因,及 Android 获得屏幕物理尺寸、密度及分辨率
- start
- 栈(C语言)
- HDU 2489 Minimal Ratio Tree(prim+DFS)
- 网站的分布式架构一