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 / sanjay

to make servlet as threas safe we have three approaches
1.do not instance variables into our servlet we use only
local variables
2.by using synchronized methods
3.synchronized blocks
above three ways synchronized blocks is the best way

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can the session in servlet be destroyed?

1110


What is load-on-startup in servlet?

1083


What is cookie in servlet?

1021


What is war file?

1036


What is life cycle of Servlet?

1027


What are Servlets?

1061


How can we upload the file to the server using servlet?

1017


Can we use threads in Servlets?

1097


What is the difference between servlet and jsp?

1065


How can you push data from an Applet to a Servlet?

1048


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?

1213


Explain url encoding in servlet?

1007


What are the life-cycle methods for a servlet?

950


How do we call one servlet from another servlet?

993


What is meant by Servlet? What are the parameters of service method?

1016