title: Trying Struts 2 for the first time and getting 404 Not Found Error. How would I solve this?
body: <p>I am new to struts and little confused about project in regards of Web apps. I am practicing simple struts project with following:</p>
  
  <p>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.devMode" value="true" /&gt;
  
      &lt;package name="helloworld" extends="struts-default"&gt;
  
          &lt;action name="sayhello" class="com.demo.action.HelloAction"&gt;
              &lt;result name="success"&gt;/hello.jsp&lt;/result&gt;
              &lt;result name="error"&gt;/error.jsp&lt;/result&gt;
          &lt;/action&gt;
  
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;WebContent&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;/WebContent&gt;
  </code></pre>
  
  <p>HelloAction.java</p>
  
  <pre><code>package com.demo.action;
  
  import com.opensymphony.xwork2.ActionSupport;
  
  public class HelloAction extends ActionSupport{
  
      public String execute() {
  
          return SUCCESS;
      }
  
  }
  </code></pre>
  
  <p>And this is my project structure:
  <a href="https://i.stack.imgur.com/QjnuA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QjnuA.png" alt="hello-struts"></a></p>
  
  <p>My error:
  <a href="https://i.stack.imgur.com/QNnnL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QNnnL.png" alt="404 Not Found Error"></a></p>