Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Vallidation Using Annotation + Struts 2

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am trying to validate field but fields are not getting validated.

bellow is my POJO class.



I have also enabled the client side validation as bellow



 
Leonardo Carreira
Ranch Hand
Posts: 489
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you are using hibernate, i think you can use hibernate validator..

Thank's
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless

What happens? Are there any JavaScript errors? I don't recall if JavaScript validation requires the use of the <s:head> tag but it might--can't hurt to add it if it isn't there.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wait, that's not the action? Did you set the visitor validation (or whatever it's called) on the action property that uses this class? Otherwise there's nothing to tie the validation to the action.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic