Javaスプリングを使用して実行時にBeanのプロパティを動的に変更する方法を教えてください。 私はbean "mainView"を持っています。これは、 "class1"または "class2"のいずれかのプロパティ "class"として使用する必要があります。 この決定は、プロパティファイルのベースで行う必要があります。プロパティ "withSmartcard"は "Y"または "N"です。スプリングスプリングを動的に変更する
のApplicationContext:
<bean id="mainView"
class="mainView">
<property name="angebotsClient" ref="angebotsClient" />
<property name="class" ref="class1" />
</bean>
<bean id="class1"
class="class1">
<constructor-arg ref="mainView" />
</bean>
<bean id="class2"
class="class2">
<constructor-arg ref="mainView" />
</bean>
PropertyFile:
withSmartcard = Y
{$ classIdToBeUsed}または$ {classIdToBeUsed}としますか? –
$ {classIdToBeUsed} :) Typo、ありがとう!明らかに、私はKSSのためにwithSmartCardClassImplementation – Olivier