
One possible way is to define your own protocol: (add-validation validation-forms "error message") (valid-p object) returning two values, Boolean representing validity after applying all validation rules. otherwise returning nil and the second value holding errors if they exists. then you can use it with multiple-value-bind (multiple-value-bind (valid-p errors) (validate object) (if valid-p (save object) ; persist it (otherwise report back the errors to the user)) this is only a sketch, you may use any thing else that suits your requirements. regards, Ala'a (cmo-0) On Thu, Aug 27, 2009 at 12:26 PM, Eric Abrahamsen<girzel@gmail.com> wrote:
define-easy-handler has some pretty extensive features for accepting GET/POST parameters, but when it comes to validating those parameters, and possibly returning errors to the client, it seems like the only viable thing to do is write a standard handler function and work with get-parameters* and post-parameters* directly.
Does anyone have any experience to share in this direction? How is everyone handling more complex form validation and error reporting? Has there ever been any talk of a small external library for doing validation?
Eric
_______________________________________________ tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
-- It does not matter how fast your code is, if it does not work!