请问
如何修改被 importresource 加载的 xml 文件 (sslconfig.xml)里面定义的变量的 ${servicespecific.service.soap.keypass} ?
@ImportResource(value = { "classpath:config/sslconfig.xml", "classpath:META-INF/cxf/cxf.xml" })
public class MyApplication
这个是我的 sslconfig.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sec="http://cxf.apache.org/configuration/security"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
xsi:schemaLocation="http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<httpj:engine-factory>
<httpj:engine port="${servicespecific.service.soap.httpsport}">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="${servicespecific.service.soap.keypass}">
<sec:keyStore file="${servicespecific.service.soap.keystore}" password="${servicespecific.service.soap.keypass}" type="${servicespecific.service.soap.keytype}"/>
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore file="${servicespecific.service.soap.truststore}" type="${servicespecific.service.soap.keytype}"/>
</sec:trustManagers>
<!-- sec:clientAuthentication want="true" required="true"/-->
</httpj:tlsServerParameters>
</httpj:engine>
</httpj:engine-factory>
</beans>
展开
作者回复: Spring的占位符替换机制都是类似的,只要有对应的PropertySource,可以找到这些属性值,就能换掉的。