Did the contextPath is available as a placeHolder for defining the path of a properties files


Did the contextPath is available as a placeHolder for defining the path of a properties files



Let start with some context:



I use something like this for properties:


<bean id="properties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="ignoreResourceNotFound" value="true"/>
<property name="locations">
<list>
<value>classpath:internal-common.properties</value>
<value>classpath:${server.contextPath}/context.properties</value>
<value>classpath:dev-overwrite.properties</value>
</list>
</property>





The internal-common and the dev-overwrite work as expected.
I can't found the correct placeHolder (not ${server.contextPath} at least) to have an external properties per context.



What I think can't work and are on lot of answer related to this:





You will need support from Spring to do this, the container has no part of this interaction. (I'm not sure if Spring does/does not have such support; I'm just mentioning that the container is not involved.)
– Christopher Schultz
2 days ago





Thanks, spring support seems to be done via stackOverflow. A solution may work with spring with some help from the container. In this case, if I use the Context.xml to set a properties, I can then use it in my spring application. However, because of different reason like the autodeploy I prefer to avoid this one if possible.
– Tristan Larouanne
20 hours ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Export result set on Dbeaver to CSV