FilterDispatcher is depredated!plesae use the new filters
来源:互联网 发布:量化投资 python 编辑:程序博客网 时间:2024/06/14 02:49
一些struts2的教程都是比较早的,当我们基于较新版本的struts2来实现代码的时候,往往会出现一些问题.比如这个警告:FilterDispatcher isdeprecated!
在web.xml中的配置如下:
- <filter>
- <filter-name>struts2</filter-name>
- <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
- </filter>
但是一运行起来就会出现,如图的警告:FilterDispatcher已经过时啦!请使用新的filter!
打开警告里提到的链接,我们可以找到 FilterDispatcher Example(web.xml)
- <web-app id="WebApp_9" version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <filter>
- <filter-name>struts2</filter-name>
- <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
- <init-param>
- <param-name>actionPackages</param-name>
- <param-value>com.mycompany.myapp.actions</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>struts2</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <!-- ... -->
- </web-app>
这FilterDispatcher Example并没有FilterDispatcher,而是变成了这一句:
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
往下看,原来从>=2.1.3的版本开始,FilterDispatcher被标记为过时,取而代之的是新的
StrutsPrepareAndExecuteFilter
所以如果你的struts版本大于2.1.3时,filter配置要变成:
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter。
如果是低于2.1.3版本,则还用本文最开始的配置即可。
0 0
- FilterDispatcher is depredated!plesae use the new filters
- >>> FilterDispatcher <<< is deprecated! Please use the new filters!
- >>> FilterDispatcher <<< is deprecated! Please use the new filters!
- >>> FilterDispatcher <<< is deprecated! Please use the new filters!
- FilterDispatcher <<< is deprecated! Please use the new filters!
- >>> FilterDispatcher <<< is deprecated! Please use the new filters!
- >>> FilterDispatcher <<< is deprecated! Please use the new filters!
- FilterDispatcher <<< is deprecated! Please use the new filters!
- ActionContextCleanUp <<< is deprecated! Please use the new filters警告
- >>> FilterDispatcher <<< is deprecated!
- >>> FilterDispatcher <<< is deprecated!
- FilterDispatcher is deprecated!
- What is the use of "?
- use-default-filters属性
- Is Ruby the New VB?
- Cache is the new RAM
- what is the use of truncate command
- the NTP socket is in use, exiting
- Eclipse高级调试技巧
- OCP-1Z0-053-200题-183题-232
- Struts2文件上传
- iOS Dev (38) 你不一定看懂了 main.m 文件
- Struts2拦截器
- FilterDispatcher is depredated!plesae use the new filters
- 跨平台移动开发phonegap/cordova 3.3全系列教程-目录
- ajax(二) ajax处理返回数据格式xml 实例
- 黑马程序员_Java基础_GUI
- note : a demo test gdi operation on win32 project
- uva1450 - Airport
- 2038——你到哪儿去了
- OCP-1Z0-053-V13.02-408题
- 送给大家一个很好的Web前端开发工具