@RequestAttribute

@SessionAttribute 类似,您可以使用 @RequestAttribute 注解来访问之前创建的预先存在的请求属性(例如,通过 Servlet FilterHandlerInterceptor):

Similar to @SessionAttribute, you can use the @RequestAttribute annotations to access pre-existing request attributes created earlier (for example, by a Servlet Filter or HandlerInterceptor):

Java
@GetMapping("/")
public String handle(@RequestAttribute Client client) { (1)
	// ...
}
1 Using the @RequestAttribute annotation.
Kotlin
@GetMapping("/")
fun handle(@RequestAttribute client: Client): String { (1)
	// ...
}
2 Using the @RequestAttribute annotation.