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()
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