aspose file tools*
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 Spring in Action this week in the Spring 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