title: HTTP 404 error in my first Struts2 application
body: <p>I have made a simple struts 2 application for my learning purpose. I have followed the tutorial from youtube. But after completing my program, when I run it, it is showing HTTP 404 error when I enter the URL: <code>http://localhost:1443/Struts2Example/hello.action</code>.</p>
  
  <p>Following is my web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"&gt;
  &lt;display-name&gt;Struts2Example&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
  &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
  &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
  &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
  &lt;filter&gt;
  &lt;filter-name&gt;Struts2&lt;/filter-name&gt;
  &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&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;
  </code></pre>
  
  <p></p>
  
  <p>Following is my Action Class</p>
  
  <pre><code>package com.subir.struts2.action;
  
  public class getAction {
  
  public String execute()
  {
  
      System.out.println("Hello !execute method ");
  
     System.out.println("Hello from get getAction!!");
     return "success";
  }
  
  }
  </code></pre>
  
  <p>Following is my 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;/constant&gt;
      &lt;package name="default" extends="struts-default"&gt;
      &lt;action name="hello" class="com.subir.struts2.action.getAction"&gt;
          &lt;result name="success"&gt;/success.jsp&lt;/result&gt;
          &lt;result name="error"&gt;/error.jsp&lt;/result&gt;
      &lt;/action&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p></p>
  
  <p>Following is my success.jsp</p>
  
  <pre><code> &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
   &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  Success Page!!!
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Following is my error.jsp</p>
  
  <pre><code>  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  
    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  
    &lt;html&gt;
   &lt;head&gt;
   &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
   &lt;title&gt;Insert title here&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
   Error page!!!
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>Following is my directory structure.</p>
  
  <p><a href="https://i.stack.imgur.com/yYvTm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yYvTm.png" alt="enter image description here"></a></p>
  
  <p>Please let me know what might be the issue causing this error.</p>