Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

apache common validation framework

 
Swapnil Dharane
Ranch Hand
Posts: 55
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to use Apache validator in my project. But I don't know how to go further after creating an instance of Validator. I am performing validation in a filter. Is it a good way? And if it is, how to proceed further?
 
Rakesh K. Cherukuri
Ranch Hand
Posts: 48
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Commons validator source distribution comes with examples. Check version of the one you are using and download the source from apache website (look for files similar to commons-validator-1.4.0-src.zip). That should get you started with validator usage.

Regarding validation in filter (assuming servlet filters), the details are not enough. Whether its a good way or not depends on what you are trying to validate. A typical use of a filter is to log message arrivals but not to validate the request content. But that doesnt mean one should not. As i said it all depends on what you are trying to achieve.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic