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 the use of servlet wrapper classes?

1241


Which application server is best for java?

1123


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

1210


Why HttpServlet class is declared abstract?

1282


What is the difference between using getSession(true) and getSession(false) methods?

1106


How to handle exceptions thrown by application with another servlet?

1142


Differentiate between the web server and application server?

1107


Tell us something about servletconfig interface.

1053


How do you run a servlet?

1108


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

1001


How do I use cookies to store session state on the client?

1027


What are the different methods of session management in servlets?

1078


what do you understand by url rewriting?

1011


What are its drawbacks of cgi?

1192


Explain the lifecycle of a servlet?

1028