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 ...

Get BEA WebLogic Server™ 8.1 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.