Lewis Sellers wrote:
> Maheshwaran S wrote:
> > Hi Java geeks,
> >
> > We are maintaining site called jMinds(
> > http://jminds.hollosite.com) features with lot of articles, programs,
> > FAQ's and with other stuff too. Resources for the technologies in java,
> > jdbc , j2ee such as JSP, Servlets, EJB ( Enterprise Java Beans ) etc
> > from the writers of DeveloperIQ magazine and others. Contains,
> > articles, source code for programming, tutorials and FAQ's.
> > jMinds Team.
> > (http://jminds.hollosite.com)
> >
>
> "
> How can I implement a thread-safe JSP page?
>
> You can make your JSPs thread-safe by having them implement the
> SingleThreadModel interface. This is done by adding the directive <%@
> page isThreadSafe="false" % > within your JSP page.
> "
>
> I've yet to write a jsp myself, and know almost nothing about it but....
> is that true?
isThreadSafe="false" makes the page thread safe? Seems
> a little counterintunitive to say the least. /-)
I'm also not very knowledgeable on JSP, but I can see where this would
make sense if the servlet container created a new servlet instance for
each request if isThreadSafe='false'.
The logic being, of course, that if the container prevents a JSP/Servlet
instance from being accessed from multiple threads/requests then the
appearance of the JSP/Servlet to the end user is as if it were threadsafe.
I'd imagine that isThreadSafe='true' would then instruct the container
to compile, generate, and instantiate one instance of the JSP to serve
content across all requests.