2

我想通过属性文件填充传输端点。我试过了,但没有用

<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:(pos 14): Field or property 'service' can not be found on object of type 'java.util.Properties'

4

1 回答 1

2

我不认为 SpEL 为Properties. 所以我认为正确的语法应该是:

#{cxfProperties.getProperty('service.wsdllocation')}

或者

#{cxfProperties.getProperty('service.wsdllocation', 'SOME_DEFAULT_VAL')}
于 2013-12-13T02:47:26.573 回答