Hi,

If your variable is declared as "member" you will have the effect you want in
term of variable initializing. A variable declare as "member" in MyServlet class
is kind of a static variable for each thread of that servlet once it has been
instanciated.

David

Todd Mytkowicz wrote:

> Hello all,
>
> In my servlet, I create an instance variable as such...
>
> private boolean temp = false;
>
> ...
>
> An instance of this servlet is created the first time the servlet is called.
> My understanding is that this variable is only initialized that first time.
>
> Is this temp variable implicitly static? ie, if one user changes the
> variable, will other servlets see that change?
>
> In more general terms, I want this variable to act as a global variable with
> a seperate value to each request.
>
> If user A requests my servlet and changes the temp to true, will subsequent
> users see a value of true?
>
> Thanks for the help.
>
> Todd Mytkowicz:
> [EMAIL PROTECTED]
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to