liveBook · Manning

Servlet request attribute

A servlet request attribute is a named value attached to an individual HTTP request for access by request-processing components or view rendering.

How 2 Manning books explain it

Spring Security in Action, Second Edition

A request attribute is a named value attached to an HTTP request for access by components processing that request.

How it is used
Provides a handoff point for passing a CSRF token from CsrfFilter to a later servlet filter.
How deep it goes
Explains named-value retrieval, CsrfToken casting, filter ordering, and request testing, but not general servlet attribute internals.
Examples
Uses CsrfTokenLogger, the _csrf attribute, curl GET and POST requests, and HTTP 403 behavior.
What you can do after
Diagnose CSRF handling by retrieving and logging the token from a request attribute.

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

Spring in Action, Sixth Edition

A request attribute is a named value associated with an individual web request and made available to request-processing components or view rendering.

How it is used
Connects Spring MVC model data to Thymeleaf view rendering through servlet request attributes.
How deep it goes
Explains copying model data, reading values, and iterating collections, without detailing servlet internals.
Examples
Uses a message paragraph and a taco ingredient collection rendered with Thymeleaf expressions.
What you can do after
Apply it via Thymeleaf by reading named values and repeating markup for collection-valued attributes.

Read how Spring in Action, Sixth Edition explains servlet request attribute →

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.