tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Baringer <>
Subject Re: wrapper.bin.parameters
Date Fri, 11 May 2001 09:57:05 GMT
try this (in web.xml)


And then from a servlet (or JSP):

String agent = getServletContext().getInitParameter("SecretAgent");

and the following will be true:
(agent == "007")

For more info the API docs are always the best place
(javax.servlet.Servlet, javax.servlet.ServletConfig,

Getting a ServletContext is always direct as the interface
javax.servlet.Servlet does not provide a getServletContext method so
you'd have to do
Servlet.getServletConfig().getServletContext(), however the class
GenericServlet does provide a getServletContext() method (which is
just sugar)

how this helps
Ring the bells that still can ring.
Forget the perfect offering.
There's a crack in everything.
It's how the light gets in.
	-Isonard Cohen

View raw message