title: How to configure dynamic "input" results in Struts2
body: <p>Suppose I configure a "per method" validation into my action, using the Struts2 validation framework (in my example with annotations, but also with xml it is the same).
  Suppose I have three public exposed methods in my action:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class MyAction extends ActionSupport {
  
      @Override
      public String execute() throws Exception {
  
          //some code here...
      }
  
      @Validations(
          customValidators = {@CustomValidator(type="myCostomValidator", fieldName="myFieldName", shortCircuit=true, message="")}         
      )
      public String info() {
  
          //some code here...
      }
  
      @Validations(
          customValidators = {@CustomValidator(type="myCostomValidator", fieldName="anotherFieldName", shortCircuit=true, message="")},
          visitorFields = {@VisitorFieldValidator(context="update_context", fieldName="anObjectField", message="", shortCircuit=true)}            
      )
      public String update() {
  
          //some code here...
      }
  
      //getters, setters and other...
  }
  </code></pre>
  
  <p>Now, each of the three methods can be invoked and has a different validation. If the validation fails the framework set the result "input" that must be configured into the struts.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;action name="myAction_*" method="{1}" class="com.test.gui.action.test.MyAction"&gt;
      &lt;result name="success"&gt;result1.jsp&lt;/result&gt;
      &lt;result name="edit"&gt;result2.jsp&lt;/result&gt;
      &lt;result name="input"&gt;result3.jsp&lt;/result&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>How can I have different "input" results for each action method? For example, I'd like to reach one page if the validation fails for the info() method and another page if the validation fails for the update() method.
  Thank you.</p>