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

Who is responsible to create the object of servlet?

1168


Define servlet mapping?

1116


How do you invoke a servelt?

1071


What are sessions in servlets?

1029


How we can call a jsp from the servlet?

964


What are all the advantages of servlet over cgi?

1031


When should you prefer to use doget() over dopost()?

1099


What is new in ServletRequest interface ? (Servlet 2.4)

978


What is cookies in servlet with example?

1042


What is the difference between CGI and Servlet?

1020


What is load-on-startup in servlet?

1083


What are advantages of servlets over cgi?

1055


What is the GenericServlet class?

1172


How do I support both get and post from the same servlet?

1180


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

972