BEA WebLogic Server™ 8.1 Unleashed
by Mark Artiges, Gupreet Singh Bhasin, Bernard Ciconte, Malcolm Garland, Saranathan Govindarajan, James Huang, Subramanian Kovilmadam, Kunal Mittal, Paul J. Perrone, Tom Schwenk, Steve Steffen
Servlet Thread Models
Before we look into using some of the functions we've seen as part of the Servlet API, we have to look at the threading model available for servlet developers. As mentioned earlier in the chapter, a servlet that implements the HttpServlet or the Servlet interface is capable of handling concurrent requests at the same time. A single servlet instance that's created either by the first request or at server startup time spawns multiple threads to handle all these requests through the doGet() or the doPost() method, based on the request type. In this programming model, the programmer should take care to handle all the shared data in the request processing method via service(), doGet(), and so forth. This is done by using synchronized ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access