Warning FilterDispatcher is deprecated please use the new filters

Warning FilterDispatcher is deprecated please use the new filters


Posted in : Java Posted on : December 30, 2014 at 12:05 AM Comments : [ 0 ]

In the latest version of Struts 2 new filter is introduced and if you application is using old FilterDispatcher then application will display the warning message filterdispatcher is deprecated please use the new filters.

Solving the warning filterdispatcher is deprecated please use the new filters message in Struts 2 application

There is changes in the latest version of  Struts 2 framework and if you are still using the old version of FilterDispather, you application will starting warning you for using the latest filters.

For example if you application is still using the following old filter:

org.apache.struts2.dispatcher.FilterDispatcher

in the web.xml file then its time to change the code and start using the latest filers.

The filter org.apache.struts2.dispatcher.FilterDispatcher is deprecated in the from the Struts 2.13 version and now you should not use this filter.

Old code in of the web.xml file:

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

New code to be used is:

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

Following is the video description of the tutorial:

Above video shows you how to resolve the error. If you use the old version of FilterDispatcher following warning will come:

FilterDispatcher is deprecated please use the new filters

***********************************************************************
* 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 *
* *
***********************************************************************

To resolve this you should use the latest filter class (org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter).

Check more at Rose India Struts 2 Tutorials and tutorials of Struts 2.

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics