|
From: Alef A. <al...@jt...> - 2004-03-05 16:33:45
|
Oops, I guess (no I don't guess, I know for sure ;-) manually = instantiating a BeanWrapperImpl won't give you the additional PropertyEditors = registered through CustomEditorConfigurer, if that's what you meant! The = BeanWrapper doesn't know of anything like an ApplicationContext when just = instantiating it. I'm using the BeanWrapperImpl in some rare cases as well (same reason, = it's really convenient). I wouldn't know how to add additional custom editors to beanwrappers instantiated manually. The solution Guillaume is suggesting (with Sun's PropertyManager) will not work; since Spring doesn't use it (security restrictions might give problems there). Alef > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On = Behalf > Of Chris Winters > Sent: Friday, March 05, 2004 4:58 PM > To: spr...@li... > Subject: Re: [Springframework-developer] "permanantly" registering > property editor with BeanWrapper? >=20 > Alef Arendsen wrote: > > It's not possible to do this via a static on the BeanWrapper. It IS > possible > > however... > > > > J=FCrgen added a CustomEditorConfigurer that you can use to do this. = Just > add > > it to you app context and you're done. > > > > <!-- taken from JavaDOC --> > > <bean id=3D"customEditorConfigurer" > > ... >=20 > Excellent! That should work just fine. >=20 > > If you're programmatically using the BeanFactory, you can add > > propertyeditors using registerCustomEditor from the BeanFactory (or = use > a > > BeanFactoryPostProcessor). >=20 > This is what I started doing, but if I instantiate a > BeanWrapperImpl myself the editors aren't available. (I'm just > using the BeanWrapper as a shortcut to do some property mapping > because it's so darned convenient.) >=20 > Plus I'm not sure how to do this from an ApplicationContext vs. a > BeanFactory -- the registerCustomEditor() seems to be implemented > in AbstractBeanFactory which doesn't seem to be a parent of any > ApplicationContext class. (I'm a little hazy on the relationships > among the objects at this level tho.) >=20 > Thanks! >=20 > Chris >=20 > -- > Chris Winters (cwi...@op...) > Senior Software Architect >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |