1

How can i set the context param-value with an environment variable in web.xml?

I tried to do it like below, but it didn't work

<context-param>
  <param-name>testName</param-name>
  <param-value>${TEST_HOME}</param-value>
</context-param>

Where $TEST_HOME will be an environment variable.

is there any way to put external variables in web.xml ?

StackUser
  • 67
  • 2
  • 8
  • Possible duplicate of [Referencing Environment Variables in web.xml](https://stackoverflow.com/questions/1404384/referencing-environment-variables-in-web-xml) – Alex R Sep 28 '19 at 18:48

1 Answers1

1

You may try like this:

<env-entry>
    <env-entry-name>Name</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>value</env-entry-value>
</env-entry>
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
  • 2
    Thanks for the reply. but is it possible to use the OS environment varibales directly in web.xml? – StackUser Aug 12 '14 at 17:50
  • Wrong answer, please see https://stackoverflow.com/questions/1404384/referencing-environment-variables-in-web-xml instead – Alex R Sep 28 '19 at 18:49