JSPs are servlets. Servlets are singeltons. The variable (i) that you define
in one servlet is seen by ALL clients. If you want per client state you will
need to store it in a session,

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Enrique P�rez Soler
> Sent: 18 September 2000 08:50
> To: [EMAIL PROTECTED]
> Subject: Session management
>
>
> Hi all,
>
> With the following JSP:
> <%! int i = 0 %>
> <%=i++%>
>
> Each time I reload the JSP in my browser, I get the incremented value.
> But if someone else loads the same JSP, the counter starts at i+1,
> and not at 0.
>
> How can I separate both sessions?
>
> Thank you.
>
> --
>
> --------------------------
> "El bit es al hombre lo que el �tomo a Dios"
> Enrique P�rez Soler
> mailto:[EMAIL PROTECTED]
> http://ttt.teleco.upv.es/~enpeso
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to