我想通过属性文件填充传输端点。我尝试了这个,但它不起作用
<util:properties id="cxfProperties" location="/WEB-INF/classes/cxf.properties" />
<util:list id="transportEndpoints">
<!--
<value>http://localhost:8080/doubleit/services/doubleit.*</value>
-->
<value>#{cxfProperties.service.wsdllocation}</value>
</util:list>
在我的属性文件中,我有
service.wsdllocation=http://localhost:8080/doubleit/services/doubleit.*
我收到错误:
表达式解析失败;嵌套异常是 org.springframework.expression.spel.SpelEvaluationException: EL1008E :(位置14):无法找到现场或财产'服务' 'java.util.Properties'
类型的对象
答案 0 :(得分:2)
我认为SpEL不会为Properties
中的属性提供直接字段访问语法。所以我认为正确的语法应该是:
#{cxfProperties.getProperty('service.wsdllocation')}
或
#{cxfProperties.getProperty('service.wsdllocation', 'SOME_DEFAULT_VAL')}