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
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What are the 3 types of control structures?
How can you set an applet’s height and width as a percentage?
What are wrapper classes?
What are the 5 types of research methods?
how and when compiler knows that the Java code throws the checked Exception.
What is the char data type?
What is thread count in java?
What is the difference between serialization and deserialization?
Can we create an object of static class in java?
We have two methods to create methods the threads. 1. Implementing runnable interface 2. Extending to thread class and overriding run method. Among these two which one is better and why? Please explain me in detail.
what is object deep copy and shallow copy and why it is required?
What is queue in java?