liveBook · Manning

Servlet filter

A servlet filter is a web component that intercepts requests and responses to inspect, transform, process, or reject them before or after servlet execution.

How 3 Manning books explain it

ASP.NET Core in Action, 3e

IActionFilter is an ASP.NET Core interface for synchronous MVC filters that run before and after action-method execution.

How it is used
Extracts checks and response customization from MVC controller actions into reusable code that runs around action execution.
How deep it goes
Explains execution timing, action arguments, short-circuiting, scope, and dependency injection through worked filter examples.
Examples
Uses ModelState validation, a missing-item check, and a refactored web API controller to demonstrate action filters.
What you can do after
Build it from scratch as a synchronous MVC action filter that checks bound arguments or validation state and can bypass an action.

Read how ASP.NET Core in Action, 3e explains servlet filter →

Spring Security in Action, Second Edition

An HTTP filter is a web-processing component that intercepts and can modify or reject HTTP requests and responses.

How it is used
Intercepts requests to validate input, extend authentication, audit events, or alter processing before responses reach clients.
How deep it goes
Descends from chain ordering to doFilter implementation and stops short of enumerating every framework-provided filter.
Examples
Uses Request-Id validation, authentication-event logging, curl requests, HTTP 400 responses, and OncePerRequestFilter.
What you can do after
Build it from scratch by implementing Filter, control chain placement with HttpSecurity, and select a Spring base class when justified.

Read how Spring Security in Action, Second Edition explains servlet filter →

Kubernetes in Action, Second Edition

A Gateway API filter is a route-rule operation that modifies, mirrors, or otherwise processes requests and responses.

How it is used
Processes matched HTTP or gRPC traffic by modifying, rewriting, redirecting, mirroring, or extending route behavior.
How deep it goes
Defines filter types and concrete manifests, then demonstrates results with requests and logs, stopping at route configuration and behavior.
Examples
Uses header manifests, path replacement, HTTPS redirection, service mirroring, curl requests, and backend pod logs.
What you can do after
Operate/configure HTTPRoute and GRPCRoute rules for header changes, path rewrites, redirects, traffic mirrors, and custom filters.

Read how Kubernetes in Action, Second Edition explains servlet filter →

Related concepts

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.