aspose file tools*
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 Spring in Action this week in the Spring 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?