I'm trying to set up a very basic(generic) validation with struts 1.1 (and 
tiles) and I can not get it to work. I'm not getting any errors or anything. 
Validation simply doesn't take affect.
  I believe I have everything in place. Here is some snippets from my file. 
Please let me know if you know what the issue is. 
   
  Based on  my configuration, my user id field should be required, however I 
can proceed w/o entering any text in there!
   
   
  from my validation.xml:
   
  <form name="genericForm">
  <field property="user.userId" depends="required">
  <arg0 key="User ID" resource="false"/> 
  </field> 
  </form> 
   
   
  From my ApplicationResources.properties:
  errors.required={0} is required.
   
  From my struts-config.xml
  <action path="/generic" 
  type="com.raytheon.its.action.generic.GenericAction" 
  name="genericForm"
  scope="request" 
  input="/WEB-INF/pages/generic.jsp" 
  validate="true">
  <forward name="success" path="generic" />
  </action> 
  
   
   
  My Form: 
   
  public class GenericForm extends ValidateActionForm {
  
    private UserTO user;
  
    //getter and setters for the user go here
  
  }
   
  *NOTE that UserTO has an attribute called userID, hence the nested field 
property name in validation.xml
   
   
  From my generic.jsp
  ...
  <html:errors/>
  <!-- declare the nested object -->
  <nested:root name="genericForm">
  <nested:nest property="user">
  
  ...
  <tr>
  <th align="left">User ID:</th>
  <td><nested:text property="userId"/></td>
  </tr>
  

                
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2ยข/min or less.

Reply via email to