程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> JAVA編程 >> JAVA綜合教程 >> 【structs2】>>> FilterDispatcher <<< is deprecated!,filterdispatcher

【structs2】>>> FilterDispatcher <<< is deprecated!,filterdispatcher

編輯:JAVA綜合教程

【structs2】>>> FilterDispatcher <<< is deprecated!,filterdispatcher


在struts2.3.31下,web.xml中使用

…
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>

會出現
***********************************************************************
*                               WARNING!!!                            *
*                                                                     *
* >>> FilterDispatcher <<< is deprecated! Please use the new filters! *
*                                                                     *
*           This can be a source of unpredictable problems!           *
*                                                                     *
*              Please refer to the docs for more details!             *
*            http://struts.apache.org/2.x/docs/webxml.html            *
*                                                                     *
***********************************************************************

原因在於:


Class FilterDispatcher Deprecated. Since Struts 2.1.3, use StrutsPrepareAndExecuteFilter instead or StrutsPrepareFilterand StrutsExecuteFilter if needing using the ActionContextCleanUp filter in addition to this one..即,從Struts 2.1.3起已被標注為過時的,改用StrutsPrepareAndExecuteFilter
解決方法,將web.xml上述代碼改為:

<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved