| 
         
            | ValidationAndList |  |  
            | Your trail: |  
 
      
      
         
      
          Difference between 
          version 27 
          and 
          version 26:
           
          
| At line 11 changed 1 line. |  | * [1] Add XDoclet tags (@struts.validator) to Person.java |  | * [1] Add XDoclet Validator to Person.java |  | At line 20 changed 2 lines. |  | !!Add XDoclet tags (@struts.validator) to Person.java [#1] |  | To use the Validator with Struts, normally you have to write a validation.xml file by hand.  If you're not using AppFuse, you also have to configure the Validator Plugin and error keys in your ApplicationResources_en.properties.  For more information on this, see the [Validation Made Easy Tutorial|http://www.reumann.net/do/struts/lesson3/step8]. |  | !!Add XDoclet Validator to Person.java [#1] |  | To use Commons Validator with Struts (or Spring MVC), normally you have to write a validation.xml file by hand.  If you're not using AppFuse, you also have to configure the Validator Plugin and error keys in your ApplicationResources_en.properties.  For more information on this, see the [Validation Made Easy Tutorial|http://www.reumann.net/do/struts/lesson3/step8]. |  | At line 23 changed 1 line. |  | Using XDoclet, it's much easier - we just need to add a couple of ''@struts.validator'' tags to our POJO (Person.java).  So open it up (src/dao/**/persistence/Person.java) and modify your setFirstName and setLastName methods to resemble the following: |  | Using XDoclet, it's much easier - we just need to add a couple of ''@struts.validator'' (or ''@spring.validator'') tags to our POJO (Person.java).  Let's open it up (src/dao/**/persistence/Person.java) and modify your setFirstName and setLastName methods to resemble the following: |  | At line 46 changed 1 line. |  | ;:__Spring MVC:__ If you're using Spring for your MVC layer - use @spring.validator tags and put them on the ''setter'' methods, rather than the getters. |  | %%(color: green)__Spring MVC:__ If you're using Spring for your MVC layer - use @spring.validator tags and put them on the ''setter'' methods, rather than the getters.%% |  
      Back to ValidationAndList,
       or to the Page History.
        |