JSP is by default thread safe or not? what is the meaning of
isThreadSafe="true" and isThreadSafe="false". Explain it?

Thanks,
Seenu

Answers were Sorted based on User's Feedback



JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / saravanan sagadevan

isThreadSafe is true means, doesn't implement
SingleThreadModel.So its not a thread safe. if
ThreadSafe=false, SingleThreadModel is implemented ,ant
This page is Thread safe.

Is This Answer Correct ?    32 Yes 0 No

JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / mahesh

isThreadSafe="true" meaning saays that our servlet doesnot
provide the implementation of Single ThreadModel
interface.so single instance can handle multiple Requests.

Is This Answer Correct ?    12 Yes 2 No

JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / nehru

Accroding to java documention, default value for jsp page
attribute 'isThreadsafe', is set to true, which means jsp
can handle multiple client requests and does not implement
SingleThreadModel interface.

Well, thinking gramatically, meaning of 'isThreadsafe' is to
clarify or to assert whether jsp is threadsafe or not.
So it makes sense when you put it's value to true ie.
isThreadsafe = true, meaning jsp is now thread safe and so
should handle one request at a time ie. it should implement
SingleThreadModel interface.
And isThreadsafe = false implies, jsp is not thread safe and
so it can handle multiple client requests.

Is This Answer Correct ?    20 Yes 16 No

JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / t.kumar

JSP can access by more than one user at the same time. We
can make JSP thread safe by using JSP attribute in directive
page tag. Thread safe JSP can take one request at one time
to processing. In thread safe JSP single instance of JSP
Servlet loaded. By default JSP is not thread safe, we have
to use isThreadSafe attribute of page. When isThreadSafe
attribute set as false, no multiple request send by JSP
engine to handle.

<%@ page isThreadSafe="false" %>

Is This Answer Correct ?    1 Yes 0 No

JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / bijay

<%@ page isThreadSafe="true" %> means you are specifying that the JSP page is thread-safe and hence, Container should create one Servlet instance and use it to handle mulitple client requests.

On the other hand, <%@ page isThreadSafe="false" %> means you are specifying that the JSP page is not thread-safe, so th Container should take necessary precaution. Container does this by queueing up requests and handling them one at a time.

Is This Answer Correct ?    1 Yes 0 No

JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / ayush dayal

Bydefault isThreadSafe is set to 'true' in jsp, if we want
to make it not a thread safe then we have to set the value
of isThreadSafe is 'false'.

Is This Answer Correct ?    1 Yes 2 No

JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / anil kumar

JSP is by default threadsafe...

Bydefault isThreadSafe is set to 'true' in jsp, if we want
to make it not a thread safe then we have to set the value
of isThreadSafe is 'false'.

I hope you understand...

Thank u....

Is This Answer Correct ?    5 Yes 8 No

JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / vikas

jsp is not thread safe.
if threadsafe="true" it means only one thread can access an
object at a time.
if threadsafe="false" it means multiple threads can access
one object at a time concurrently.

Is This Answer Correct ?    20 Yes 27 No

JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isTh..

Answer / srinu

JSP is by default its not a thread safe suppose we prevent
the JSP page from thread safe then

if threadsafe="true" it means only one thread can access an
object at a time.it handle only client request at time.it
should implements singleThreaded model interface.


isThreadsafe = false implies, jsp is not thread safe and
so it can handle multiple client requests.i.e means number
of clients access the only object

Is This Answer Correct ?    6 Yes 16 No

Post New Answer

More Core Java Interview Questions

Can you explain the final method modifier?

0 Answers  


What is static synchronization?

0 Answers  


what is server side caching?

0 Answers   AIG,


What are synchronized methods and synchronized statements in java programming?

0 Answers  


Can list be final in java?

0 Answers  






What is Mutex (Mutual Exclusion Object) ?

0 Answers   Ciena,


What is the difference between path and classpath variables?

0 Answers  


When should I use stringbuffer?

0 Answers  


What is difference between Iterator and for loop

9 Answers   HP,


What is map and hashmap? also tell the difference.

1 Answers  


Scenario: There are 1 to 100 numbers. Each number should be keep in the each column like from A column to Z column ie 1 to 26. From 27 to 52 should be in 2nd row in the excel sheet. This has to be continue till 100. How do you write Java program and what are various methods.

4 Answers   Cap Gemini,


What is an object’s lock and which object’s have locks?

0 Answers  


Categories