tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danno Ferrin" <shem...@earthlink.net>
Subject Re: BugRat Report #143 has been filed.
Date Thu, 21 Sep 2000 05:17:04 GMT
[SNIP]

> The page is behaving exactly as it is supposed to -- this is not a bug.
>
> Variables you declare inside <%! ... %> become *instance* variables in the
> generated servlet, which are shared across all requests because there is
only
> one instance of that servlet in memory.
>
> If you want to declare variables that are local to the service() method of
the
> generated servlet (and therefore not shared between requests) you need to
do
> this instead:
>
>     <% int i; %>
>     <% int j; %>
>
> (Note the lack of an exclamation point).


Also try adding to the top of the page <%@ page isThreadSafe="false" %>,
this will prevent multuple threads from executing the same page.  it is
almost like the page being a servlet implementing SingleThreadedModle.

--Danno


Mime
View raw message