@RequestAttribute

@SessionAttribute 類似,您可以使用 @RequestAttribute 註解訪問早期建立的預先存在的請求屬性(例如,由 Servlet FilterHandlerInterceptor 建立的)

  • Java

  • Kotlin

@GetMapping("/")
public String handle(@RequestAttribute Client client) { (1)
	// ...
}
1 使用 @RequestAttribute 註解。
@GetMapping("/")
fun handle(@RequestAttribute client: Client): String { (1)
	// ...
}
1 使用 @RequestAttribute 註解。
© . This site is unofficial and not affiliated with VMware.