Annotation Interface RequestAttribute
Annotation to bind a method parameter to a request attribute.
The main motivation is to provide convenient access to request attributes from a controller method with an optional/required check and a cast to the target method parameter type.
- Since:
- 4.3
- Author:
- Rossen Stoyanchev
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
-
name
-
required
boolean requiredWhether the request attribute is required.Defaults to
true
, leading to an exception being thrown if the attribute is missing. Switch this tofalse
if you prefer anull
or Java 8java.util.Optional
if the attribute doesn't exist.- Default:
true
-