You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stefano Bonnin <sh...@libero.it> on 2001/07/25 13:23:02 UTC

Shared Variables

Hi,

I have noticed that when I start my application under Tomcat 3.2.1 all the
variables are shared!!!! If I access for the first time and I set for
example Name="mouse", at the second access (another session!) the Name
variable is equal to "mouse"??? Why? Is a Tomcat bug?

Help me!

Thanks.




Re: Shared Variables

Posted by Stefano Bonnin <sh...@libero.it>.
Yes, I tried your suggest but it happens the same thing. I have also used
the Nokia Wap Toolkit ....

My application is developed with Cocoon/XSP tecnologies and run on Tomcat
3.2.1. Perhaps I have to define the variable in another way, but I don't
know....


----- Original Message -----
From: "Loïc Lefèvre" <ll...@fivia.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, July 25, 2001 1:33 PM
Subject: RE: Shared Variables


> Did you use Internet explorer twice for these tests ?
> In this case, it appears for me too.
> Try to run TWO process Internet Explorer not CTRL+N (new window) then
> try your application on these two browsers.
>
> Loïc Lefèvre
>
> -----Message d'origine-----
> De : Stefano Bonnin [mailto:shpr@libero.it]
> Envoyé : mercredi 25 juillet 2001 13:23
> À : tomcat-user@jakarta.apache.org
> Objet : Shared Variables
>
>
> Hi,
>
> I have noticed that when I start my application under Tomcat 3.2.1 all the
> variables are shared!!!! If I access for the first time and I set for
> example Name="mouse", at the second access (another session!) the Name
> variable is equal to "mouse"??? Why? Is a Tomcat bug?
>
> Help me!
>
> Thanks.
>
>
>


RE: Shared Variables

Posted by Loïc Lefèvre <ll...@fivia.com>.
Did you use Internet explorer twice for these tests ?
In this case, it appears for me too.
Try to run TWO process Internet Explorer not CTRL+N (new window) then
try your application on these two browsers.

Loïc Lefèvre

-----Message d'origine-----
De : Stefano Bonnin [mailto:shpr@libero.it]
Envoyé : mercredi 25 juillet 2001 13:23
À : tomcat-user@jakarta.apache.org
Objet : Shared Variables


Hi,

I have noticed that when I start my application under Tomcat 3.2.1 all the
variables are shared!!!! If I access for the first time and I set for
example Name="mouse", at the second access (another session!) the Name
variable is equal to "mouse"??? Why? Is a Tomcat bug?

Help me!

Thanks.




Re: Shared Variables

Posted by Stefano Bonnin <sh...@libero.it>.
ok ok I have solved the problem ....

Thanks...

----- Original Message -----
From: "Dmitri Colebatch" <di...@bigpond.net.au>
To: <to...@jakarta.apache.org>
Sent: Wednesday, July 25, 2001 2:05 PM
Subject: Re: Shared Variables


> Hi,
>
> Variables in what sense?  As in variables in a servlet?  They are suppose
> to be shared.  It is up to you to ensure that your servlet is thread safe
> (there will only be one instance of a servlet created by Tomcat).  If you
> want to store a variable in the session, the use something like:
>
> HttpSession session = request.getSession(true);
> session.setAttribute("variable", "mouse");
>
> Is this what you're asking about?
>
> cheers
> dim
>
> On Wed, 25 Jul 2001, Stefano Bonnin wrote:
>
> > Hi,
> >
> > I have noticed that when I start my application under Tomcat 3.2.1 all
the
> > variables are shared!!!! If I access for the first time and I set for
> > example Name="mouse", at the second access (another session!) the Name
> > variable is equal to "mouse"??? Why? Is a Tomcat bug?
> >
> > Help me!
> >
> > Thanks.
> >
> >
> >
> >
>


Re: Shared Variables

Posted by Dmitri Colebatch <di...@bigpond.net.au>.
Hi,

Variables in what sense?  As in variables in a servlet?  They are suppose
to be shared.  It is up to you to ensure that your servlet is thread safe
(there will only be one instance of a servlet created by Tomcat).  If you
want to store a variable in the session, the use something like:

HttpSession session = request.getSession(true);
session.setAttribute("variable", "mouse");

Is this what you're asking about?

cheers
dim

On Wed, 25 Jul 2001, Stefano Bonnin wrote:

> Hi,
> 
> I have noticed that when I start my application under Tomcat 3.2.1 all the
> variables are shared!!!! If I access for the first time and I set for
> example Name="mouse", at the second access (another session!) the Name
> variable is equal to "mouse"??? Why? Is a Tomcat bug?
> 
> Help me!
> 
> Thanks.
> 
> 
> 
>