title: Need Help in struts2 Validation
body: <p>I Have following in my struts.xml file</p>
  
  <pre><code>&lt;action name="ProductVerification" class="com.frontend.ProductVerification"&gt;
      &lt;result name="success"&gt;/jsp/product_verification.jsp&lt;/result&gt;
      &lt;result name="input"&gt;/jsp/product_verification.jsp&lt;/result&gt;
      &lt;result name="error"&gt;/jsp/product_verification.jsp&lt;/result&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>I have following in my html code
      </p>
  
  <pre><code>&lt;s:form name="frmVerification" id="frmVerification" onsubmit="Javascript: return checkFrmVerification(this);"  &gt;
  
  &lt;s:select name="countryId" id="cmbcountryid"  headerKey="0"  headerValue="%{getText('label.Please_Select')}" list="%{countryListCombo}" listKey="countryId" listValue="country" value="countryId" cssClass="style2" onchange="Javascript: GetCities();" required="true" /&gt;
  
  &lt;s:submit name="submit" src="images/submit_btn.jpg" type="image" value="submit" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>I have execute method as below.</p>
  
  <pre><code>public String execute() throws Exception {
  
      Session session = this.getHibernateSession();
  
      Transaction tx = session.beginTransaction();
  
      //Following will set combo box containing country list
      this.setCountryListCombo();
  
      tx.commit();
  
      return SUCCESS;
  }
  </code></pre>
  
  <p>I am overriding validate method as below.</p>
  
  <pre><code>@Override
  public void validate() {
   HttpServletRequest request = this.getServletRequest();
  
       if(request.getParameter(countryId) == 0){
            addFieldError("countryId", "Please select country");
       }
  
  }
  </code></pre>
  
  <p>Now when I execute my action it will show me form with countryId combo box filled with countries.</p>
  
  <p>Now when I submit form without selecting combo box it should show me error.</p>
  
  <p>But instead of showing error "Please select country" It gives me following error.</p>
  
  <p>Struts Problem Report</p>
  
  <p>Struts has detected an unhandled exception: </p>
  
  <p><strong>Messages:</strong> tag 'select', field 'list', name 'countryId': The requested list key '%{countryListCombo}' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name}</p>
  
  <p><strong>File:</strong>   org/apache/jasper/servlet/JspServletWrapper.java</p>
  
  <p><strong>Line number:</strong>    522</p>
  
  <p>Can any one tell me why is it so?</p>
  
  <p>It seems that after validate() method giving result="input", it is not calling execute() method and instead tries to show "/jsp/product_verification.jsp" page directly.</p>
  
  <p>Please help me solving the problem.</p>
  
  <p>Thanks.</p>