title: Struts2 multiple forms with token not working. Only one token at a time working
body: <p>I am trying to develop an application in struts2 where I have multiple forms and may or may not have same action. To avoid CSRF I also added token with these forms, but only one token at a time working. If I clicked on another submit button then I am redirecting to error page which is configured for CSRF. I am stuck here why this is happening, am not able to use multiple token on same page or is there any solution for this. </p>
  
  <p>Please find struts2.xml code which I have configured.</p>
  
  <pre><code>&lt;action name="expUsers" class="com.org.action.ExpUser"&gt;
     &lt;interceptor-ref name="CSRFStack"/&gt;
     &lt;result name="invalid.token" type="tiles"&gt;csrfError&lt;/result&gt;
     &lt;result name="success" type="stream"&gt;
         &lt;param name="contentDisposition"&gt;contentDisposition&lt;/param&gt;
         &lt;param name="contentType"&gt;application/octet-stream&lt;/param&gt;
         &lt;param name="inputName"&gt;inputStream&lt;/param&gt;
     &lt;/result&gt;
     &lt;result name="failed" type="chain"&gt;csrfError&lt;/result&gt;             
  &lt;/action&gt;
  </code></pre>
  
  <p>I have the following dummy form example below which will let you understand what i am doing.</p>
  
  <pre><code>&lt;form id="form-1"&gt;
  &lt;s:token/&gt;
  ....
  &lt;/form&gt;
  
  &lt;form id="form-2"&gt;
  &lt;s:token/&gt;
  ....
  &lt;/form&gt;
  
  &lt;form id="form-3"&gt;
  &lt;s:token/&gt;
  ....
  &lt;/form&gt;
  
  ... so on multiple forms with token.
  </code></pre>