title: Struts 2 - HTTP Status 404 - No result defined for action
body: <p>I'm trying to develop a Struts2 app where an action is invoked upon clicking a hyperlink which directs the user to a hello.jsp using Struts action mapping. I'm getting the following error:</p>
  
  <pre><code>HTTP Status 404 - No result defined for action com.manaar.action.HelloAction and result success
  </code></pre>
  
  <p>My files are as follows. My mapping looks like it's in order. I also checked other postings on here but can't seem to find the cause or solution to this problem. Would really appreciate any advice. Many thanks, J</p>
  
  <p><strong><code>index.jsp</code>:</strong></p>
  
  <pre><code>&lt;%@ page contentType="text/html;charset=UTF-8" language="java"%&gt;
  &lt;%@ taglib uri="/struts-tags" prefix="s"%&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;s:text name="app.title" /&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" href="mystyle.css" type="text/css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;center&gt;
      &lt;h2&gt;
          Struts 2 Actions
      &lt;/h2&gt;
      &lt;br&gt;
      &lt;br&gt;
      Welcome
      &lt;s:property value="#session.user" default="Guest" /&gt;!
      &lt;s:if test="#session.user!=null"&gt;
          &lt;s:url id="logout" action="logout" /&gt;
          | &lt;s:a href="%{logout}"&gt;Logout&lt;/s:a&gt; |
      &lt;/s:if&gt;
      &lt;br&gt;
      &lt;table cellspacing="5" width="180"&gt;
          &lt;tr bgcolor="#f0edd9" height="25" align="center"&gt;
              &lt;td&gt;
                  &lt;s:url id="hello" action="hello"/&gt;
                  &lt;s:a href="%{hello}"&gt;Hello Action&lt;/s:a&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr bgcolor="#f0edd9" height="25" align="center"&gt;
                  &lt;td&gt;
                  &lt;s:a href="add_user.jsp"&gt;Add User&lt;/s:a&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr bgcolor="#f0edd9" height="25" align="center"&gt;
                  &lt;td&gt;
                  &lt;s:a href="user.jsp"&gt;View Users&lt;/s:a&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr bgcolor="#f0edd9" height="25" align="center"&gt;
                  &lt;td&gt;
                  &lt;s:a href="login.jsp"&gt;Login&lt;/s:a&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong><code>struts.xml</code>:</strong></p>
  
  <pre><code>&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;!-- Configuration for the default package. --&gt;
  &lt;package name="default" extends="struts-default"&gt;
      &lt;action name="hello" class="com.manaar.action.HelloAction" method="wateva"&gt;
          &lt;result name="success"&gt;/hello.jsp&lt;/result&gt;
      &lt;/action&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong><code>HelloAction.java</code>:</strong></p>
  
  <pre><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package com.manaar.action;
  import com.opensymphony.xwork2.Action;
  import static com.opensymphony.xwork2.Action.SUCCESS; 
  
  public class HelloAction implements Action {
  
  String message;
  
  public String getMessage() {
      return message;
  }
  
  public void setMessage(String message) {
      this.message = message;
  }
  
      /**
   *
   * @return
   * @throws Exception
   */
  @Override
  public String execute() throws Exception {
      setMessage("Hello From Struts!");
      return SUCCESS;
  }
  }
  </code></pre>