Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2: Problem with form validation using validation xml

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