[Webwork-user] Where should validation happen?
Brought to you by:
baldree,
rickardoberg
From: Francisco H. <fhe...@fh...> - 2002-05-23 18:16:11
|
I've been wondering, where should validation happen? both domain type checking (ie: valid integer, valid phone number, valid date) and other business type checking (ie: this user does infect belong to this group, this item can be added to the cart) I've seen doValidation() but that doesnt seem to work with CommandDriven interface (although I was thinking for some kind of method to to call doCreateValidation() when doCreate() command is run or maybe in actions.xml having a validator attribute that specifies the method to be called when the command is run) right now ive just validating data in my action methods (ie: doCreate() contains all of the validation code), another thing i was thinking about was doing the domain type checking inside the parameter setters (ie: setUser() checks that the User is valid) I'd like to hear what methods of validation you guys are using.. |