How to get web.xml parameters in ServletContextListener?

T

Todd Peterson

I have created a class that implements ServletContextListener and
NotificationListener and would like to read in some parameters out of
the web.xml file... These parameters will vary across environments,
so I will probably have some ANT "filters" that will populate the
web.xml file, utilizing a .properties file, when an ANT build is
performed.

I have tried to read "<init-param>" parameters from the ServletContext
to no avail. I've peeked at the BEA documentation, which discusses
defining a Listener object, but doesn't explain how to provide config
information for it through the web.xml file.

I would like to avoid, if at all possible, creating a separate config
file as I don't want to maintain different config files for my
development, test and production environments.

Any suggestions would be greatly appreciated!

p.s. I'm somewhat of a newbie, so please be gentle... ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top