aspose file tools*
The moose likes Struts and the fly likes Struts 2 validation using  Annotation is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 validation using  Annotation is not working" Watch "Struts 2 validation using  Annotation is not working" New topic
Author

Struts 2 validation using Annotation is not working

Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

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

Joined: Aug 03, 2011
Posts: 1
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

Joined: Sep 30, 2010
Posts: 290

i forgot to see , the Model validation :P

Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

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

Joined: Sep 30, 2010
Posts: 290

Use Double , it's working fine!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 validation using Annotation is not working
 
Similar Threads
Vallidation Using Annotation + Struts 2
separate validation for each method in action class
problem in struts validation
After validate ajax form not redirect to success or error result
Struts2 validation using annotaions for Model Driven