Q: How to load a file as a context parameter value in a Tomcat/Java/Spring application? I'm using my context.xml file to set init parameters for my java application, for example:
<Parameter
    name="Environment"
    description="The environment in which this code is running (e.g. Production, Staging, Development)."
    value="Production"/>

I would like to be able to create a parameter who's value attribute is loading from a file.  Is there anyway to do this?  Should I be using a < Resource > element instead?  If so, how do I setup a resource to load the contents of a file?  I've tried Google, but I my not understand the context.xml file well enough to know what to look for.  Any help is much appreciated!

A: In application-context.xml add this element
<context:property-placeholder ignore-unresolvable="true" location="classpath*:application.properties"/>

In the file application.properties you can define parameters like this
userName=root
password=123

And then you can use the parameters by this way
    <property name="username"  value="${userName}"/>
    <property name="password" value="${password}"/>

