我正在使用Spring Web Services将服务公开为Web服务.在我的spring配置xml文件中,我有一个bean,它是DefaultWsdl11Definition的一个实例.需要设置的属性之一是locationUri.这需要是一个完全合格的Uri,但是当应用程序从dev升级到uat和生产时,我不想更改此值.Spring知道Web应用程序上下文根是什么,所以我可以在配置文件中指定一个变量来访问它吗?
就像是:
<bean id="myWebServices"
class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
<property name="schemaCollection">
<bean
class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
<property name="xsds" ref="xsdList"/>
<property name="inline" value="true" />
</bean>
</property>
<property name="portTypeName" value="myWebServices" />
<property name="locationUri" value="${webContextRoot}/webServices" />
</bean>
Run Code Online (Sandbox Code Playgroud)