wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts2: Problem with form validation using validation xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2: Problem with form validation using validation xml" Watch "Struts2: Problem with form validation using validation xml" New topic
Author

Struts2: Problem with form validation using validation xml

kailash murthy
Greenhorn

Joined: Dec 08, 2011
Posts: 2
Hi All,
I just created a sample form to "Add a Product". Added a validation xml to validate the form. But the form is not getting validated. Whereas if I override the validate() method in Action class, validation is happening. Problem existing only with validation using xml. Kindly help me in sorting out the problem.
Find my code snippets,

struts.xml



Product.jsp



Product-validation.xml


Product.java



Kindly help me to sort out the issue. Thanks













kailash murthy
Greenhorn

Joined: Dec 08, 2011
Posts: 2
Posting my package structure.



[Thumbnail for package_structure.png]

Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

I don't see a problem. But still you can try this:
1. change the method name from insert to something that may not have the chance of being a keyword.
2. try renaming the validation.xml as Product_save-Product-validation.xml

Let me know if any of this works.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2: Problem with form validation using validation xml
 
Similar Threads
problem in struts validation
Out of Memory when testing a BMP Bean
Action class not being called after validation
Struts2 very simple validation doesn't work
Form Validation using xml in struts2