Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
Articles_pt
CreateActions
CreateActions_de
SpringControllers_ko
ValidationAndList_pt




JSPWiki v2.2.33

[RSS]


Hide Menu

ValidationAndList


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.