tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arion" <>
Subject Re: servlet question !!
Date Thu, 08 Jun 2000 08:33:32 GMT

The answer should be 'undeterministic'.

Servlet are created and initialize once and repeated use of it employ
the SAME instance. However, the servlet engine may choose to unload some
of the servlets whenever she thinks appropriate (maybe the servlet has
not been used for a long time and the memory is running out).


Manpreet wrote:

> HI all, I have a small servlet code like this: import*;import
> javax.servlet.*;import java.servlet.http/*; public class Test extends
> HttpServlet {        int count=0;        public void
> doGet(HttpServletRequest req , HttpServletResponse res) throws
> IOException , ServletException {            PrintWriter
> out=res.getWriter();            out.write(count++);        }} Is it
> possible that each request to this servlet gets the initial value of
> count i.e. 0 thanks in advance ,Manpreet Singh.

View raw message