tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Merrill Cornish <>
Subject Thread Safe JSP/Servlets
Date Mon, 29 Dec 2003 18:54:34 GMT
I understand how to write thread-safe software in general, but I suddenly realized that I don't
understand what, if anything, Tomcat "shares" among different sessions (i.e., different users
accessing the same JSP application) and would therefore be thread sensitive.

For example, in my servlets, I have only constant class fields--no instance fields.  All user-specific
information is stored in session attributes that exist only between user login and logout.
 However, it finally dawned on me that my JSP pages are quietly being turned into servlets
behind my back (this is despite my occassionally referencing the generated *_jsp files while
debugging), and those servlets DO have instance fields.

My specific question is whether Tomcat keeps the instance fields for JSP servlets separate
by session.  My more general request is for a pointer to "best practices" documentation on
how to keep JSPs and servlets thread safe.

Merrill Cornish

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message