File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Form Validation using action-validation.xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Form Validation using action-validation.xml file" Watch "Form Validation using action-validation.xml file" New topic
Author

Form Validation using action-validation.xml file

jas preet
Ranch Hand

Joined: Mar 31, 2010
Posts: 76

Hi,
I am trying for days to validate my form using validation framework of struts, I am not able to figure out the problem. I have seen many posts. Did as they say. But all in vain. Not able to validate. Please help me figure out the problem in my code.
I have a login form that needs to be validated. I am new to struts. So this is just a test program.


login.jsp




LoginAction.java



LoginAction-validation.xml



struts.xml



Any help will be appreciated. No error message is displayed.

Thanks Jaspreet ----- Nothing is permanent
Ashwini Kashyap
Ranch Hand

Joined: Aug 30, 2012
Posts: 90
Hi Jas,

The problem is I think while calling action in login.jsp.

Use, <s:form action="login" method="post" validate="true"> instead of action= "login.action". This might work.

Thanks and Regards,
Ashwini Kashyap | akashyap@infocepts.com | www.infocepts.com

 
wood burning stoves
 
subject: Form Validation using action-validation.xml file
 
Similar Threads
validation in struts2
validation using Resource Bundle
Struts2 Validation Not working
Action class not being called after validation
Form Validation using xml in struts2