How to make servlet thread safe?
Answer Posted / tulasi vani
There are two different ways of making a servlet thread
safe namely
1.By implementing SingleThreadModel.
By implementing a SingleThreadModel it will be possible to
create a Thread safe servlet.There can only be one user at
a given point of time.
2.Synchornize the part of sensitive code.
We can allow a single user at a given point of time by
making that part of the code which is sensitive as
synchronized.
| Is This Answer Correct ? | 127 Yes | 6 No |
Post New Answer View All Answers
What are the important functions of filters?
What is war file?
What exactly are the functions of servlet?
Can we refresh servlet in client and server side automatically?
Whether we can get deadlock situation in servlets?
Tell the new features added in servletrequest interface i.e. Servlet 2.4
Is servlet thread safe?
How printwriter is different from servletoutputstream?
What do you mean by filter in servlet?
How to commuincate between an applet and a servlet?
What do you mean by the servlet chaining?
If my browser does not support cookie, and my server sends a cookie instance what will happen?
How do you load an image in a Servlet?
What do you mean by annotations in servlet?
How native code can be used in a servlet?