title: Populate fields after redirect in struts 2
body: <p>I'm trying to understand if there is an easiest and shorter way to populate the fields of a form, after it fails validation and it's redirected (following the pattern described <a href="http://www.theserverside.com/news/1365146/Redirect-After-Post" rel="nofollow">here</a>).</p>
  
  <p>I have a form that is called from addPerson.action action, and submit action is savePerson.action.
  If it fails validation, I redirect passing all parameters, so that the redirected page will populate the fields with the data inserted by the user, avoiding the user the hassle to start from scratch.
  The problem of this solution is that I have to list every single parameter of the form in the struts.xml, like in the example below:</p>
  
  <pre><code>&lt;action name="savePerson" class="personAction" method="savePerson"&gt;
          &lt;interceptor-ref name="store"&gt;
              &lt;param name="operationMode"&gt;STORE&lt;/param&gt;
          &lt;/interceptor-ref&gt;
          &lt;interceptor-ref name="myStack" /&gt;
          &lt;result name="success" type="redirectAction"&gt;
              &lt;param name="actionName"&gt;listPeople&lt;/param&gt;
          &lt;/result&gt;
          &lt;result name="input" type="redirectAction"&gt;
              &lt;param name="actionName"&gt;addPerson&lt;/param&gt;
              &lt;param name="parse"&gt;true&lt;/param&gt;
              &lt;param name="person.name"&gt;${person.name}&lt;/param&gt;
              &lt;param name="person.surname"&gt;${person.surname}&lt;/param&gt;
              &lt;param name="person.gender"&gt;${person.gender}&lt;/param&gt;
              &lt;param name="person.email"&gt;${person.email}&lt;/param&gt;
              &lt;param name="person.mobile"&gt;${person.mobile}&lt;/param&gt;
          &lt;/result&gt;
      &lt;/action&gt;
      &lt;action name="addPerson" class="personAction" method="addPerson"&gt;
          &lt;interceptor-ref name="store"&gt;
              &lt;param name="operationMode"&gt;RETRIEVE&lt;/param&gt;
          &lt;/interceptor-ref&gt;
          &lt;interceptor-ref name="myStack" /&gt;
          &lt;result name="success"&gt;/person/add.jsp&lt;/result&gt;
          &lt;result name="input"&gt;/person/add.jsp&lt;/result&gt;
      &lt;/action&gt;
  </code></pre>
  
  <p>I had to use the MessageStoreInterceptor in order to save and retrieve the validation error messages from a redirect.</p>
  
  <p>I'm already using the ajax validation, but I wish to make my pages work in non javascript mode as well. With the code above everything works as expected, but looks weird that I have to list all my parameters inside the result tag.</p>
  
  <p>Is there a better and shorter way of doing it?
  thanks</p>