I'm very sorry, but I really think you're interpreting this the other way
around.
isThreadSafe=true  doesn't mean that JSP's are thread safe by default. au
contraire,
it means that they run in a multithreaded environment and are _assumed_ to
be thread safe by the servlet engine. If they are not, you might specify
isThreadSafe=false to make the servlet engine use the singleThreadModel. I
really think you should never do this in a real application. It has too many
performance problems.

Most of the JSP pages are thread safe because they only use local variables.
That's one of the reasons I mentioned it on this thread several times
already that you shouldn't use <%! %> tags to declare variables unless you
know very well what you're doing. But, alas, we see so many examples who do
it wrong (and people sometimes are upset if you tell them about it).
Anyway, if you just declare your variables locally in <% %> tags or in
custom tags, you shouldn't worry too much about thread safety.

But that has hardly anything to do with the original question.
well, of course you can spawn a thread in a JSP
<% new Thread(){
        public void run(){
                // your code
        }
   }.start();%>
But it's cleaner to put that in a separate object, not in the page directly.

Geert Van Damme



> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of vikas m pawar
> Sent: zaterdag 17 maart 2001 19:01
> To: [EMAIL PROTECTED]
> Subject: Re: Spawning a thread
>
>
> JSP pages are by default thread safe(isThreadSafe=true)
> If set to false, the JSP page uses the Single Thread Model.
> Regards
> Vikas
> ___________________________________________________
>
>
> To know recursion, you must first know recursion.
>
> _____________________________________________________
> Chat with your friends as soon as they come online. Get Rediff Bol at
> http://bol.rediff.com
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to