1

I am following this tutorial to build my first Struts2 example.

My project name (and war file also) is HelloWorld and whenever I try to access http://localhost:8080/HelloWorld/index.jsp I get

The requested resource is not available.

I have my war file in tomcat webapps directory and tomcat is running fine.

Where am I going wrong?

Roman C
  • 49,761
  • 33
  • 66
  • 176
user1079065
  • 2,085
  • 9
  • 30
  • 53
  • possible duplicate of [Error 404 issues using Struts application](http://stackoverflow.com/questions/18419661/error-404-issues-using-struts-application) – Roman C Oct 01 '14 at 17:19

1 Answers1

1

That tutorial is OLD.

It still uses org.apache.struts2.dispatcher.FilterDispatcher , that is a deprecated filter since Struts 2.1.8.

You need to use the new filter: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.

Then ensure you have both the filter and the filter-mapping correctly set in your web.xml:

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

<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
Community
  • 1
  • 1
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
  • org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils – user1079065 Sep 30 '14 at 15:51