Hello All,
We have a need to somehow obtain the contextRoot name for a WAR deployment in the applicationContext.xml in order to specify the correct property file to use with a BridgePropertyPlaceholder bean. We need something like below (although this doesn't work):
<bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:${contextRoot}.properties</value>
</list>
</property>
</bean>
Does anyone know if the context root name is somehow accessible through Spring in the applicationContext?
Cheers,
Tim
Nevermind....
I found the magic I was looking for by using SPeL and accessing the ServletContext to get the contextPath (not contextRoot) like so:
#{servletContext.contextPath}