Best practices for defining and initializing variables in web.xml and then accessing them from Java

Posted by DutrowLLC on Stack Overflow See other posts from Stack Overflow or by DutrowLLC
Published on 2010-03-12T18:27:40Z Indexed on 2010/03/12 18:37 UTC
Read the original article Hit count: 474

Filed under:
|
|

I would like to define and initialize some variables in web.xml and the access the values of these variables inside my Java application.

The reason I want to do this is because I would like to be able to change the values of these variables without having to recompile the code.

What is the best practice for doing this? Most of the variables are just strings, maybe some numbers as well. Does the class that accesses the variables have to be a servlet?

Thanks!

Chris

© Stack Overflow or respective owner

Related posts about web.xml

Related posts about java