문제

I would like to populate transport End points via properties file. I tried this but it didn't work

<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>

In my properties file I have

service.wsdllocation=http://localhost:8080/doubleit/services/doubleit.*

I get error:

Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 14): Field or property 'service' cannot be found on object of type 'java.util.Properties'

도움이 되었습니까?

해결책

I don't think SpEL provides direct field access syntax for property in Properties. So I think the correct syntax should be:

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

or

#{cxfProperties.getProperty('service.wsdllocation', 'SOME_DEFAULT_VAL')}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top