【发布时间】:2012-01-04 07:45:37
【问题描述】:
我需要将一个 spring bean 的字符串值连接到一个现有的字符串,然后将其设置为另一个 bean 的属性:
<bean id="inet" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass"><value>java.net.InetAddress</value></property>
<property name="targetMethod"><value>getLocalHost</value></property>
</bean>
<bean id="host" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject"><ref local="inet"/></property>
<property name="targetMethod"><value>getHostName</value></property>
</bean>
此时,我在“主机”bean 中有主机名。我现在需要连接它并将其传递给 publishedEndpointUrl 属性。像这样的:
<jaxws:endpoint
id="foo"
publishedEndpointUrl= "http://" + host + "/Foo"
implementor="com.example.v1.foo"
address="/v1/Foo"/>
这是如何使用spring xml配置完成的?
【问题讨论】:
标签: java spring jax-ws cxf spring-ws