title: How to forward result to another action in Struts2?
body: <p>I have this action:</p>
  
  <pre><code>package com.test;
  
  import com.opensymphony.xwork2.Action;
  
  public class TestAction implements Action{
      private String simpleParam;
  
      public String getSimpleParam() {
          return simpleParam;
      }
  
      public void setSimpleParam(String simpleParam) {
          this.simpleParam = simpleParam;
      }
  
      @Override
      public String execute() throws Exception {
          return SUCCESS;
      }
  }
  </code></pre>
  
  <p>When it's executed I want to invoke another action inside struts(e.g. not redirect) and pass to it simpleParam. SecondAction is:</p>
  
  <pre><code>package com.test;
  
  import com.opensymphony.xwork2.Action;
  
  public class HelloAction implements Action {
      private String id;
      private String result;
  
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      public String getResult() {
          return result;
      }
  
      @Override
      public String execute() throws Exception {
          result = "result" + getId();
          return SUCCESS;
      }
  }
  </code></pre>
  
  <p>I saw working example when in struts.xml in result simply typed another action name and params and it worked. So I'm trying to do this:</p>
  
  <pre><code>&lt;struts&gt;
      &lt;package name="main" extends="struts-default"&gt;
          &lt;action name="test" class="com.test.TestAction"&gt;
              &lt;result name="success"&gt;hello.action?id=${simpleParam}&lt;/result&gt;
          &lt;/action&gt;
          &lt;action name="hello" class="com.test.HelloAction"&gt;
              &lt;result&gt;/hello.jsp&lt;/result&gt;
          &lt;/action&gt;
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>
  
  <p>Idea totally sees this action but in browser I get 404 status. When I simply invoke hello.action from browser it works. Redirect also works. I also tried chain, but my param wasn't passed and it's not very convinient.
  Am I doing it right? And if so what could be the cause of 404 status?</p>