File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2: Problem with form validation using validation xml

 
kailash murthy
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posting my package structure.
package_structure.png
Package Structure
[Thumbnail for package_structure.png]
 
Nitin Surana
Ranch Hand
Posts: 129
Java Netbeans IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic