tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: is there only static objects in Tomcat?
Date Tue, 18 Jun 2002 22:01:51 GMT


On Tue, 18 Jun 2002, Ray Letts wrote:

> Date: Tue, 18 Jun 2002 15:00:23 -0700
> From: Ray Letts <rletts@etc.bc.ca>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>,
>      rletts@etc.bc.ca
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> Subject: is there only static objects in Tomcat?
>
>
> I read a previous thread where someone stated that: "you know that
> Tomcat creates all objects as static?"
>

There is no such thing as "creating an object as static".  You might be
confusing this with creating a single instance of a servlet, which is
shared across all requests to that servlet.

Fundamentally, this means you cannot use static or instance variables in
our servlet class to maintain per-request state information.  Use local
variables in our methods, or pass things around as request attributes, in
order to deal with this.

Craig


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message