|
From: Justin F. <jus...@hy...> - 2006-07-14 07:21:05
|
Hi All,
I am using a Map as my form backing object. I am registering a
CustomNumberEditor (see below).
protected void initBinder( HttpServletRequest request,
ServletRequestDataBinder binder ) throws Exception
{
super.initBinder( request, binder ); //To change body of
overridden methods use File | Settings | File Templates.
binder.registerCustomEditor( Long.class, "criteriaMap
[justin]", new CustomNumberEditor( Long.class, true ) );
}
This works fine. If i enter a long value into the field, it gets
converted to a long and stored against the property 'justin' in the
map. However if the data entered into the field is invalid. I get
the stack tracked displayed in my browser as apposed to the nice bind
errors I would expect to see.
After some investigation I found the following. (Code taken from
the BeanWrapperImpl:setPropertyValue(....))
If the propVal is of type list. Then the 'convertIfNecessary' method
call is wrapped in a try/catch block. But for a Map it is not.
Just wondering if this is a bug? If so. How would I go about
proving a patch to fix this problem?
Thanks for your help
Justin Fowler
Hyro Servcies Limited
|