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
Can we refresh servlet in client and server side automatically?
How do I support both get and post from the same servlet?
What is called Session Tracking?
I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>
What are the important functions of filters?
Which application server is best for java?
Write a hello world program using servlets.
What do you mean by deployment descriptor?
What are the drawbacks of cgi?
Explain the difference between get and post method in servlet?
Explain servlet life cycle?
What is servlet collaboration?
What do you mean by web applications? Explain web application directory arrangement?
Why is http protocol called as a stateless protocol?
Explain the difference between generic servlet and http servlet?