title: Struts2 execute multiple results off of one action from the struts.xml file
body: <p>I want to run two action results from the struts.xml file off of one click from a submit button on a form. Is this possible, and if so how? I have a short example below:</p>
  
  <p>After hitting my submit button on my form is there anyway in struts2 to run both action result <strong>success_csv</strong> and reload the page with result <strong>success</strong></p>
  
  <p>I have a form on my <strong>index.jsp</strong> such as: </p>
  
  <pre><code>&lt;form id="example" name="example" action="makecsv" &gt;
  &lt;!-- form sutff --&gt; 
  &lt;input class="submit" type="submit" value="Submit" &gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In my <strong>strut.xml</strong> file I have this action:</p>
  
  <pre><code>&lt;action name="makecsv" class="com.example.actions.MakecsvAction"&gt;
  
  &lt;result name="success_csv" type="stream"&gt;
  
              &lt;param name="contentType"&gt;image/jpeg&lt;/param&gt;
              &lt;param name="inputName"&gt;fileStream&lt;/param&gt;
              &lt;param name="contentDisposition"&gt;attachment;filename="${filename}"&lt;/param&gt;
              &lt;param name="bufferSize"&gt;1024&lt;/param&gt;
  
  &lt;/result&gt;
  &lt;result name="success"&gt; index.jsp &lt;/result&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>Action result success_csv will stream out a file that the user can save or open. Action result success will open index.jsp.  </p>
  
  <p>Also my action file <strong>MackcsvAction.java</strong>:</p>
  
  <pre><code>public class RegisterAction extends ActionSupport   
  {
  public String execute() throws Exception 
  {
       //blahblah code that creates csv file 
       //sets the filename and fileStream of the file
  
       return "succes_csv";
  }
  }
  </code></pre>
  
  <p>Right now it only gives the csv file I would like it also to open index.jsp</p>