Edwin DeSouza wrote:
> Anyone want to create WebWork example that does the stuff in this Article
> about Struts ?
> http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts_p.html
Done, in CVS :-) (New record I think, WebWork is indeed very efficient
and fast to work with)
The example mapped pretty well to WebWork, and it was especially nice to
see the generic controls in action! Worked perfectly!
One thing that was missing from WebWork was some validation callback
with properties whose values could not be set (string->int conversion
failed for example). I added an IllegalArgumentAware interface which has
"addIllegalArgumentException(field, exception)". If the WebWork
dispatcher gets an IAE from a propertyeditor when it tries to convert
the input string to the property's type, it will be propagated to the
action if IAA is implemented. ActionFormSupport has been changed to
implement this interface, and the default implementation is to add the
IAE message as a field error message (VERY CONVENIENT!). So, if you have
a custom property editor for each property you wont have to do any
validation AT ALL in your action, since the property editor will do the
validation, propagate any error to ActionFormSupport, which in turn will
propagate the error to a generic control. Very very nice.
Is this cool or what? :-)))
regards,
Rickard
--
Rickard Öberg
Email: ri...@jb...
|