The context in which Web components execute is an object that implements the ServletContext interface. You retrieve the Web context with the getServletContext method. The Web context provides methods for accessing:
Resources associated with the Web context
The Web context is used by the Duke’s Bookstore filters filters.HitCounterFilter and OrderFilter, discussed in the section Filtering Requests and Responses (page 227). The filters store a counter as a context attribute. Recall from Controlling Concurrent Access to Shared Resources (page 220) that the counter’s access methods are synchronized to prevent incompatible operations by servlets that are ...