A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Problem in ValidationUtils
Joined: Oct 18, 2010
Oct 19, 2012 05:12:32
I have two fields in Person Class
I want to validate that both the names should be given by the user at the same time
ValidationUtils only gives the method to check on a particular field, how can I validate this?
Joined: Mar 07, 2010
Oct 19, 2012 06:59:26
Put hibernate validator on your class path.
In your spring controller you can add @Valid to the model object you wish to validate. Then just use the JSR-303 annotations on your fields. Like @NotBlank or @NotNull.
Here is an example.
How To Ask Questions
Read before you PM me
subject: Problem in ValidationUtils
How to resize JFrame programmatically?
validating xml with xsd
jQuery Galleria Photogallery problem in quirks mode
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014