This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Apache commons validator, bean properties to validate should all be string? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Apache commons validator, bean properties to validate should all be string?" Watch "Apache commons validator, bean properties to validate should all be string?" New topic
Author

Apache commons validator, bean properties to validate should all be string?

Ali Pirzada
Greenhorn

Joined: Jul 29, 2012
Posts: 3
I was working on apache commons validator latest. Problem explained below.

My Bean is having 2 properties fullName (String) & age (int). Validation "required" on both but age needed to be checked for "integer" as well.


Note: 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: http://aspose.com/file-tools
 
subject: Apache commons validator, bean properties to validate should all be string?
 
Similar Threads
validaion.xml and validaton-rules.xml file not calling
[SPRING] Java Bean doesn't get prepared
struts validation framework error
Cannot load a validator resource
LookupDispatch action with validator