title: 404Error-Struts2 Example(Running well when test on pure jsp of Dynamic We Project 3.0 web module)
body: <p>I follow this article <a href="http://java.dzone.com/articles/struts2-tutorial-part-27" rel="nofollow">http://java.dzone.com/articles/struts2-tutorial-part-27</a> to learn struts 2 and got 404 error on my tomcat server 7, i have tested 
  another pure jsp of Dynamic We Project 3.0 web module on the same tomcat server 7, it works good. So what caused the error on struts example, since there are just few files in this example, so the first thing came in my mind is the deployment descriptor web.xml in struts 2 example, here is the original one:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;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"&gt;
  
      &lt;display-name&gt;Struts2 Application&lt;/display-name&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;struts2&lt;/filter-name&gt;
          &lt;filter-class&gt;
  
              org.apache.struts2.dispatcher.FilterDispatcher
          &lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;struts2&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  
      &lt;/filter-mapping&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;Login.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I found the difference, the original web module is 2.4, the one i created is 3.0, so i replaced </p>
  
  <pre><code>&lt;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"&gt;
  </code></pre>
  
  <p>with</p>
  
  <pre><code>&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
   http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
  </code></pre>
  
  <p>and restart the tomcat server, think may solve the problem, but i still got the error, so i got confused since there are no more particular files have relationship to the server, can some expert help me? </p>
  
  <p>Here is the struts.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE struts PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
      "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;
  
  &lt;struts&gt;
      &lt;constant name="struts.enable.DynamicMethodInvocation"
          value="false" /&gt;
      &lt;constant name="struts.devMode" value="false" /&gt;
  
      &lt;constant name="struts.custom.i18n.resources"
          value="ApplicationResources" /&gt;
  
      &lt;package name="default" extends="struts-default" namespace="/"&gt;
  
          &lt;action name="login"
              class="net.viralpatel.struts2.LoginAction"&gt;
              &lt;result name="success"&gt;Welcome.jsp&lt;/result&gt;
              &lt;result name="error"&gt;Login.jsp&lt;/result&gt;
  
          &lt;/action&gt;
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>