liveBook · Manning

Servlet

A servlet is a Java component managed by a servlet container that processes requests and generates responses, typically for web applications.

How 2 Manning books explain it

Test Driven: Practical TDD and Acceptance TDD for Java Developers

A Java Servlet is a Java component that handles requests and generates responses within a web application.

How it is used
Uses servlets as web controllers without a framework and as a starting point for testing legacy web components.
How deep it goes
Explains request dispatch and request data, then works through incremental servlet tests and authentication delegation.
Examples
Uses an echo servlet and a login servlet with mock requests, redirects, session assertions, and a fake authentication service.
What you can do after
Practice test-driving servlets with mock requests and responses and a fake authentication service.

Read how Test Driven: Practical TDD and Acceptance TDD for Java Developers explains servlet →

Spring Start Here, Second Edition

A servlet is a Java object whose methods interact with a servlet container to process HTTP requests and produce responses.

How it is used
Handles HTTP requests and builds responses through Java objects managed by a servlet container.
How deep it goes
Defines container invocation and request-response parameters, but does not detail servlet implementation.
Examples
Uses Tomcat and path-associated servlet instances to illustrate request routing and response construction.
What you can do after
Understand how a servlet container routes an HTTP request to a servlet and returns its response.

Read how Spring Start Here, Second Edition explains servlet →

Related concepts

Questions about servlet

What is servlet?

A servlet is a Java component managed by a servlet container that processes requests and generates responses, typically for web applications.

Which Manning books explain servlet?

Test Driven: Practical TDD and Acceptance TDD for Java Developers and Spring Start Here, Second Edition.

What is the difference between servlet and servlet filter?

A servlet is a Java component managed by a servlet container that processes requests and generates responses, typically for web applications. A servlet filter is a Java web component that intercepts requests and responses in a servlet-based application to process, modify, or reject them.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.