• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 validation using Annotation is not working

 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm doing validation for Name,but it seems there some problem (it's not working)

login.jsp


My Value Object has


struts.xml (piece of my struts.xml)



I really don't know what is the reason,why it's not validating

Thank You
 
kolipakula babu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

In the Form you have to add Validation= "true" like below. Try this it will work.


<s:form action="AnnotationAction" method="POST" validate="true">

Regards,
Surendra
 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i forgot to see , the Model validation :P

 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So,how to validate a long value ?? ,i can't use


which give an TypeConversion error, so what can i do,i'm not getting it,how can i solve the issue.
 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Double , it's working fine!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic