I like how Spring offers the nice PropertyPlaceholderConfigurer to facilitate using a properties file to complete the values within tokenized xml config files. I am trying to use this technique in xml I use to establish some custom surf endpoints.
I have xml that resembles this:
and the above xml (see com/rentallect/extensions/webscripts/spring-webscripts-config.xml reference below) is processed by the following config :Code:<endpoint> <id>my-endpoint</id> <connector-id>http</connector-id> <endpoint-url>http://${webscripts.host}:${webscripts.port}/${webscripts.context}/service</endpoint-url> ... </endpoint>
My app deploys fine, but when I attempt to invoke a webscript that uses the remote endpoint, things splatter. The problem seems to be that the ${} variables are not replaced with the corresponding values from the properties file.Code:<bean id="web.configsource" class="org.springframework.extensions.config.source.UrlConfigSource"> <constructor-arg> <list> <value>classpath:org/springframework/extensions/webscripts/spring-webscripts-config.xml</value> <value>classpath:com/rentallect/extensions/webscripts/spring-webscripts-config.xml</value> <value>classpath:META-INF/spring-webscripts-config-custom.xml</value> <value>jar:*!/META-INF/spring-webscripts-config-custom.xml</value> </list> </constructor-arg> </bean> <bean id="web.config" class="org.springframework.extensions.config.xml.XMLConfigService"> <constructor-arg> <ref bean="web.configsource" /> </constructor-arg> <property name="properties" value="classpath:webscripts.properties" /> </bean>
If what I'm attempting to do above is "wrong", can anyone please point out how I might go about using properties to configure custom surf endpoint values.
Thanks.


Reply With Quote
I will attempt to rectify this for the next release.