Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to make servlet thread safe?

Answer Posted / bhaskar padala

The servlet programmer should implement SingleThreadModel interface to ensure that servlet can handle only one request at a time. It is a marker interface, means have no methods.


This interface is currently deprecated since Servlet API 2.4 because it doesn't solves all the thread-safety issues such as static variable and session attributes can be accessed by multiple threads at the same time even if we have implemented the SingleThreadModel interface. So it is recommended to use other means to resolve these thread safety issues such as synchronized block etc.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a cookie What is the difference between session and cookie

1079


Why the container loads server at the application startup and how?

1064


What is servlet and list its types?

1067


Explain the jar and war files in servlet?

1104


What is the procedure of invoking different servlet in a different application?

1022


How the servlet is loaded?

1073


What is the use of java servlet api?

1035


What is called servlet mapping?

1079


How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255

3395


Define the lifecycle for executing a jsp page.

1083


What is http servlet?

1065


Describe in brief RequestDespatcher?

1139


How the typical servlet code look like ?

1235


How can the session in servlet can be destroyed?

1184


What are the steps that are involved in using the httpservlet class?

1127