I am using Tomcat 4.1.18 with JDK 1.4.0 on Solaris.

I have a page with a JSP variable declaration of the following form:

<%!
Client client;
%>

Followed by some inline code snippets:

<%
client = someForm.getClient();
%>

Followed by various sections of JSP tags where I reference attributes of
the object, e.g.:

<%= client.firstName %>

Problem is, when my application runs, the users are occasionally seeing
values from other user sessions.  This made me immediately suspect that
the generated JSP classes were not thread-sade.

I looked at the compiled code and saw that the declared variables are
translated to member variables of the HttpJspBase subclass.  If Tomcat
is not accurately tracking which JSP instances are in-use, there is a
potential for these member variables to be overwritten by other threads.

Is this a known bug or limitation in this version of Tomcat?  Am I doing
something wrong?

In the meantime, I've moved the variable declarations inside the code
snippet since that causes them to be declared in the method scope
instead of the class member scope.

Kevin Klein


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to