@RequestAttribute

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

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.