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 if we pass negative value in load-on-startup?
What's the difference between authentication and authorization?
Which is better jsp or servlet?
Given the request path below, which are context path, servlet path and path info?
How do you load an image in a Servlet?
What is the process for chaining servlet?
Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com
Explain the different ways for servlet authentication?
How can you use a servlet to generate a plain text instead of html?
Explain the difference between get and post method in servlet?
What is servlet and its use?
Write a servlet to upload file on server.
How many objects of a servlet is created?
How to upload a file to the server using servlet?
What is cookies in servlet with example?