File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Other Open Source Projects
Apache commons validator, bean properties to validate should all be string?
Joined: Jul 29, 2012
Aug 17, 2012 17:01:08
I was working on apache commons validator latest. Problem explained below.
My Bean is having 2 properties fullName (
) & age (int). Validation "required" on both but age needed to be checked for "integer" as well.
bean.setFullName("Tester"); -----> Will Pass bean.setAge("Too Old"); ---> "required Pass but "integer" Fail. results = validator.validate();
Above is possible if age property is String but its not and setAge won't accept String value and throw exception before reaching validator.validate().
Validation should be checked before we set the bean. In above situation I need to make all properties string than in validation.xml check for integer/condition.
How I work with this when my age property is Integer. little confused?
I agree. Here's the link:
subject: Apache commons validator, bean properties to validate should all be string?
Cannot load a validator resource
struts validation framework error
LookupDispatch action with validator
[SPRING] Java Bean doesn't get prepared
validaion.xml and validaton-rules.xml file not calling
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014