Class 2 |
Intermediate Java 30-IT-397 |
|
isThreadSafe Attribute
-
Threads are independent processes executing simultaneously.
-
Not really. More often than not, a time-slicing mechanism is involved.
-
With multiple accesses to the same JSP, the service method is called simultaneously
by multiple threads.
-
You must make your JSP thread safe if you want to maintain data integrity
over multiple threads.
-
Or, you can change the isThreadSafe attribute to false to only allow one
thread at a time to enter the service method.
-
<%@ page isThreadSafe="true"> default, allows multiple threads.
-
<%@ page isThreadSafe="false"> does not allow multiple threads.
-
Your best bet is really to make your JSP thread safe by using the synchronized
() {} block.
session, buffer Attributes

Created by: Brandan Jones
December 20, 2001