I defined an environment variable in web.xml as below..
<env-entry> <env-entry-name>appName</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>myApp</env-entry-value> </env-entry> Now I want to access this value in spring mvc resources tag as below.
<mvc:resources order="-10" mapping="/robots.txt" location="${jboss.home.dir}/${appName}/robots.txt" /> But the variable ${appName} is not resolving. Can you please help me out on how to read the environment entry in spring xml files?
${appName}resolved so which is it? Make sure you have a<context:property-placeholder />in your configuration. You don't need to load a file but you need it for placeholder replacement, especially for those not in the system properties or system environment.