tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Rhines" <>
Subject RE: servlet question !!
Date Thu, 08 Jun 2000 13:58:17 GMT
Will the servlet persist for at least as long as the most recent session
which used it?

-----Original Message-----
From: Arion []
Sent: Thursday, June 08, 2000 3:34 AM
Subject: Re: servlet question !!


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.

To unsubscribe, email:
For additional commmands, email:

View raw message