|
From: <jue...@we...> - 2004-12-20 12:30:35
|
Darren,
=20
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?
=20
Juergen
=20
________________________________
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
|