3

We are upgrading Web application from struts 2.3.16 to 2.5.13. We are using Web sphere application server(WAS 8.5) to run and IDE is RAD.

I have added all required JAR files but I am getting this error

Error 500: javax.servlet.ServletException: Filter [struts2]: Could not find required filter class - org.apache.struts2.dispatcher.FilterDispatcher.class  

when i checked new Struts-core-2.5.13 it does not contain org.apache.struts2.dispatcher.FilterDispatcher.class

I have made the filter changes in web.xml as below:

<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
Roman C
  • 49,761
  • 33
  • 66
  • 176

1 Answers1

2

The filter org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter doesn't exist in Struts 2.5.x.

You should use org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

For more information see

Changed filter package in Struts >= 2.5

 As from Struts 2.5 all filters were moved to top package, see example:

<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.filter.StrutsPrepareAndExecuteFilter</filter-class>
Roman C
  • 49,761
  • 33
  • 66
  • 176