tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Nuss" <>
Subject JSP: SingleThreadModel + page variables
Date Sun, 20 Feb 2000 01:07:54 GMT

I've read about the variables which persist on a page:

<%! int myvar; %>

and I'm worried that the only way that a typical Web Server can compile this
page successfully to a Servlet is by implementing the SingleThreadModel
interface!  I infer this because it claims somewhere on Sun's site that
these variables are class variables.  Obviously 2 threads using the
same instance of the servlet, each responding to their own GET requests
would be stomping on each others variables unless the SingleThreadModel
is used.

Am I correct?  Is it a requirement that these variables be implemented as
class variables?  Can they be implemented as variables declared at the top
of the scope of the doGet() method?  By a smart Web Server?


View raw message