Skip to main content

Request Attributes

Learn Request Attributes (Request Handling, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Request attributes are named objects stored on the current HttpServletRequest with setAttribute ; they live only until the response is finished. Read them in a handler with @RequestAttribute , or with request.getAttribute(name) . Typical use : a filter or interceptor computes something (user id, trace id) and the controller reads it later in the same request.

More lessons in Request Handling