tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Van Klaveren <nyb...@gmail.com>
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.


Regards,
Andre Van Klaveren, SCJP
http://www.vanklaverens.com


On Mon, 6 Dec 2004 23:22:57 +0800, zerol tib <zerol.tib@gmail.com> 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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message