In this tutorial you will learn about the page directive attribute isThreadSafe.
JSP isThreadSafe Example
In this tutorial you will learn about the page directive attribute isThreadSafe.
An attribute isThreadSafe should be used at the beginning of the JSP page. This attribute specifies how a web server will dispatch the multiple client request. This attribute has either the true or false value. By default value of this attribute is set to true. The true value specifies that the web container can dispatch the multiple client request to the JSP page and the false value specifies that the web container can dispatch a single request at a time in the specified order.
Example :
Here I am giving a very simple example of isThreadSafe page directive attribute. In this example I have created a JSP page on which I have used the attribute isThreadSafe="true" at the beginning of the page. Then I have simply write a text to display the message.
IsThreadSafeExample.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@page isThreadSafe="true" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>isThreadSafe Example</title> </head> <body> <table> <tr> <td><b>This is the example of page directive attribute isThreadSafe</b></td> </tr> </table> </body> </html>
Output :
When you will execute the above example you will get the output as follows :
[ 0 ] Comments