Environment:
Spring MVC : 4.1.7.RELEASE
CXF: 3.0.0
java: 1.8
web.xml --- loads appContext.xml (spring cofigs) & cxfContext.xml (configs for cxf)
spring-servlet.xml --- loading the spring mvc configs.
Run Code Online (Sandbox Code Playgroud)
我正在使用以下方式加载属性文件。
@Configuration
@PropertySource(value = { "classpath:config.properties" })
public class Configuration {
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
}
Run Code Online (Sandbox Code Playgroud)
属性正在得到解决,除了一种情况之外没有任何问题。
我将 CXF 用于 Web 服务,并且在使用时地址属性没有得到解析"${addressVal}"。xml 中的所有其他属性都已加载,除了"jaxws:client".
<jaxws:client id="port"
serviceClass="com.service.Myclass"
address="${addressVal}" />
Run Code Online (Sandbox Code Playgroud)
问题出在哪儿。我做错了什么。
servlet 上下文/应用程序上下文加载问题?
请指教。