• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2: Problem with form validation using validation xml

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Posting my package structure.
package_structure.png
[Thumbnail for package_structure.png]
Package Structure
 
Ranch Hand
Posts: 129
Netbeans IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic