|
From: <jue...@we...> - 2004-12-20 20:51:33
|
I've just added such an "ignoreInvalidKeys" bean property to =
PropertyOverrideConfigurer.
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von j=FCrgen h=F6ller [werk3AT]
Gesendet: Mo 20.12.2004 13:32
An: spr...@li...
Betreff: Re: [Springframework-developer] mixing =
PropertyPlaceholderConfigurer and PropertyOverrideConfigurer
Darren,
We could add an "ignoreInvalidKey" bean property to =
PropertyOverrideConfigurer, with default false. If turned on, any =
BeansException thrown by "processKey" would get caught and logged as =
warning. Is that what you have in mind?
Juergen
________________________________
Von: spr...@li... im Auftrag =
von Darren Davison
Gesendet: Mo 20.12.2004 13:14
An: spr...@li...
Betreff: [Springframework-developer] mixing =
PropertyPlaceholderConfigurer and PropertyOverrideConfigurer
I've got a context file that contains a bean with required constructor =
args
that I'd like to pull from a properties file which works fine with
PropertyPlaceholderConfigurer. However, I also have other bean =
properties
that specify sane defaults and which I'd like to be able to override =
with
definitions in PropertyOverrideConfigurer. Ideally I want to use the =
same
properties file for both.
This fails because the overrider throws an exception when trying to set
props used as constructor args (no bean named 'input' is defined); ie
beans.xml..
<bean id=3D"foo" class=3D"com.foo.Foo">
<constructor-arg =
index=3D"0"><value>${input.file}</value></constructor-arg>
<property name=3D"propOne"><value>myDefault</value></property>
</bean>
props..
input.file=3D/home/darren/some.file
foo.propOne=3Dsome-other-value
This would work if for instance overrider simply logged a message that =
no
bean was found rather than throwing an exception, but that could be
ambiguous if a bean named 'input' WAS defined.
Any way around this other than using a props-required and a =
props-optional
file which isn't very nice?
--
Darren Davison
Public Key: #DD356B0D
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|