|
From: Tom N. <tom...@gm...> - 2006-08-18 15:20:40
|
Hi spring devs -- I've got a suggestion that I'd like some help with. I'm using the MultiActionController's binding and validation capabilities (which by the way, I'd be glad to help there document a little better... ) Anyway, I'm trying to use the 'lazy' implementation, where my action methods have the command object as the third parameter. The problem is, if there are validation errors, an exception is thrown (when binder.closeNoCatch() is called on line 499 (rev 1.33). The only way to handle validation errors are: 1. Don't do it the lazy way, and manually do binding/ validation or 2. override getExceptionHandler(Throwable exception) and create a custom Exception handler for a ServletRequestBindingException. Both of these could get tedious, so I'm wondering if we could make an extension point, maybe call it handleValidationError(...) and call it at the end of MultiActionController.bind(...) if there are validation errors. The default implementation could then call binder.closeNoCatch(). Then the problem becomes, we'd normally want to return to the previous view and display form errors.... That's where my idea fails. Does anyone else see this as an opportunity for enhancement? I was going to post an issue on JIRA, but I wanted to get others' input first. Thanks! -Tom |