Request processing
As we saw in the last chapter, the context's basic valve first notifies any ServletRequestListener instances by invoking their requestInitialized() method, and then calls invoke() on the servlet wrapper's pipeline.
A wrapper's pipeline, by default, only has a single valve, the StandardWrapperValve. It calls its wrapper's allocate() method to obtain an instance of its wrapped servlet to process the incoming request.
If this is a normal servlet (that is, it does not implement the deprecated SingleThreadModel interface), then there will always be only one instance of a given servlet per wrapper, and it is this instance that is returned to service every incoming request for this servlet.
While servlets that are marked to be loaded ...
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