tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Van Klaveren <>
Subject Re: <%@page isThreadSafe="false" %> does not work
Date Mon, 06 Dec 2004 15:46:31 GMT
I have to agree with Yoav.  You shouldn't use the isThreadSafe
directive unless you absolutely have to (why would you?).  I would
reconsider your design if you think you need to use this directive.

On the other hand, AFAIK, the servlet spec only requires the container
to guarantee synchronized access to the servlet when the isThreadSafe
directive is set to true.  It doesn't specify how it is implemented. 
The SingleThreadModel has been deprecated so I wouldn't expect any
recent Servlet container to implement it.  I would guess, as I have
never used this directive, that the JSP translator would synchronize
the methods on the Servlet.  Have you checked the access modifiers on
the servlet methods?  There are probably several ways a container can
achieve synchronized access to the servlet.

Andre Van Klaveren, SCJP

On Mon, 6 Dec 2004 23:22:57 +0800, zerol tib <> wrote:
> Howdy,
> I compared two servlets' source code compiled from JSPs,
> at the beginning of  one jsp I add page directive:
> <%@page isThreadSafe="false" %>
> and  the other, <%@page isThreadSafe="true" %>.
> But the two servlet are the same , I had thought the first
> servlet will implement interface SingleThreadModel, but it
> didn't. Could anyone give me a hint?
> BTW, jsp compiler (Lomboz) says SingleThreadModel
> is deprecated.
> Thanks in advance.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message