4

Is it possible to set values in Tomcat's web.xml by fetching values from properties file?

e.g. I would like to have user roles settings externalized in properties file, is it possible then to do something like this:

my properties file:

#properties file
my.user.role=role1

my web.xml:

<security-role>
    <role-name>${my.user.role}</role-name>
</security-role>

Edit:

I've found this post, so I guess roles need to be set static in web.xml.

Community
  • 1
  • 1
Igor
  • 1,306
  • 2
  • 21
  • 40

1 Answers1

0

You can access system environment variables. Also see this post.

Community
  • 1
  • 1
mut1na
  • 785
  • 6
  • 20
  • Thanx for help, but this is not what I'm looking for. As I see **** needs to be specified in _web.xml_. But, my goal is to externalize settings, and not to '_hard-code_' them in _web.xml_, if this is possible at all. – Igor May 27 '11 at 06:40