Home Jsp JSP Thread Safe

Related Tutorials


 
 

Share on Google+Share on Google+

JSP Thread Safe

Advertisement
JSP Thread Safe is used to send only one client request for processing. It is used to implement Single Thread Model interface.

JSP Thread Safe

        

JSP Thread Safe is used to send only one client request for processing. It is used to implement Single Thread Model interface.

Understand with Example

In this section, you will learn how to use the thread safe attribute. The page directive defines an attribute 'isThreadSafe' whose value is either true or false. If the value is set to true which is a default value, the JSP container can send multiple concurrent client requests to the JSP page by starting a new thread. If the value of this attribute is set to false, then the JSP container sends client requests only one at a time to the JSP page which makes the jsp page safe. 

Syntax of isThreadSafe attribute is: <%@ page isThreadSafe="true|false" %>

 

Here is the code of threadSafe.jsp

<%@page isThreadSafe="false" %>

<html>
<head><title>Jsp Thread Safe</title></head>
<body>
<h2> Jsp Thread Safe </h2>
By using the tag <<b>isThreadSafe="false"</b>>, you can make a jsp page safe.
</body>
</html>

Output will be displayed as:

Download Source Code:

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 3, 2009

Related Tutorials

Discuss: JSP Thread Safe  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
Tushar Ranjan Das
December 11, 2011
jsp

is jsp by default threadsafe?
DMCA.com