This is related this question:
I need to inject a Spring bean into the Tomcat application's scope at startup:
<beans:bean id="myUrl" class="java.lang.String" >
<beans:constructor-arg type="java.lang.String">
<beans:value>${my.registry.location:some.url}</beans:value>
</beans:constructor-arg>
</beans:bean>
Is there a slick way to do this from the Spring XML configuration or do I need to override some servlet method (ugh)?
I thought I would post this in case it helps someone. Spring has a bean that will do this on initialization for you: ServletContextAttributeExporter.
You use it like this:
You can then do something like this in your non-Spring aware JSP code (for example):