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 / shakir khan

There are situations where we want to protect your servlet
member variables from being modified by different
clients.In this case you can have your servlet by
implementing the marker interface SigleThreadModel.

Everytime a client makes request to a servlet by
implementing this interface,servlet engine will create a
new instance of servlet.

For performance reason,servlet engine can also maintain a
instance pool,handing out instances as they are needed.Or
it could also serialize client request executing one after
another.

Is This Answer Correct ?    49 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of cookies?

1126


What is cookies in servlet with example?

1128


Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?

1258


Which java application server is the best?

1040


Define the servlet mapping.

1062


What are the exceptions thrown by servlets? Why?

1174


What is difference between jsp and servlet?

1176


What methodology can be followed to store more number of objects in a remote server?

2281


What's the difference between servlets and applets?

1051


How can a servlet be used to generate plain text instead of html?

954


What is the difference between the http servlet and generic servlet?

1148


What are the steps that are required to handle the multi-threading?

1106


What do you mean by default initialization in java servlet?

1103


Can a jsp be called using a servlet?

1144


What are the various ways of session supervision in servlets?

1013