Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache Commons Validation Framework

 
Ajay Dhar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am implementing a validation framework based on the Apache Commons Validation Framework. I am using this framework in conjunction with JSF. The program flow is the following. Data is populated in a Web form and the user clicks the submit button. The fields of the form are bound to a managed bean. An action method linked to the submit button executes and passes the managed bean to the Apache validator. The issue that I'm running into is that the validator requires that the data in the managed bean that's being passed in be a String. I would like to store data in the managed bean not as strings, but as integers, longs, floats, etc. The question is, if the managed bean stores data other than String type, how do I get the Apache validator to validate it. Note that I have the code for the Apache validator so if I knew how to modify the code I can.

I don't have the option of using the JSF validation framework (which allows the bean to have data other than string).

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't help you as I'm not using that library, but I think that you might be misunderstanding the usage of that library. There are a bunch of validators which accepts many different kind of types, not only Strings.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic