Re: Enable/Disable servlet via context param

2007-11-21 Thread Juha Laiho
Matteo Turra wrote: > I would like enable/disable a servlet depending on a context init > parameter. Have a look at the Servlet specification, and therein the chapter about Servlet Life Cycle. > I wrote this code in my servlet. But I'm not sure I the best way to do > it. > > public void init()

Enable/Disable servlet via context param

2007-11-15 Thread Matteo Turra
I would like enable/disable a servlet depending on a context init parameter. I wrote this code in my servlet. But I'm not sure I the best way to do it. public void init() { String param = this.getServletContext().getInitParameter("PARAM"); if ("ON".equalsIgnoreCase