Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Spring 3 form validation

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my application I want to validate the field which contains reference to another domain object (Address in this case). I am able to validate name and age fields, but not able to validate fields from Address class (no message is displayed on jsp).


 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us what you have tried. What does your JSP.,controller, validation logic look like?

 
sachin pachpute
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Details given below. Please note that validation is working fine for Article (only few fields I am validating for now), but isn't working for User which is referred from Article.

Article.java



User.java



ArticleController.java



relevant snippet from despatcher servlet (for JSR 303 & messages) is as below,



addArticle.jsp

 
sachin pachpute
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem is resolved for me now. Just read the document at http://docs.jboss.org/hibernate/validator/4.0.1/reference/en/html/validator-usingvalidator.html

I added,



before

 
Arthur, where are your pants? Check under this tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic