0

I'm new to spring and its bean injection framework and I need advice on understanding how to utilize them. Currently I have the following,

<beans>   
    <bean id="citationService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
        <property name="serviceUrl" value="http://localhost:8080/PPDFWeb/hello.htm"/>
        <property name="serviceInterface" value="test_client.HelloService"/>
        <property name="httpInvokerRequestExecutor">
            <bean class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor">
             </bean>
        </property>
    </bean>

</beans>

Now i need the domain name of the service url to be dynamic so I can set it somewhere programmatically in my code. Is there some way to leave the bean intact in the xml and change the serviceUrl of the bean?

goh
  • 27,631
  • 28
  • 89
  • 151

1 Answers1

0

Just mark it like:

<property name="serviceUrl" value="{serviceURL}"/>

Edit:

There are just too many solutions available on SO, I didn't do a good search earlier:

  1. reading a dynamic property list into a spring managed bean

  2. HttpInvokerProxyFactoryBean-set-url-dynamically

Community
  • 1
  • 1
mprabhat
  • 20,107
  • 7
  • 46
  • 63