使用spring和@RestController模型,我有一个带有一些@ExceptionHandler方法的@RestControllerAdvice。
我希望获得原始请求作为参数,因为我想记录它并在我的响应中使用它。
然而,在经典的MVC模型中,我尝试了处理程序方法的所有可能类型,但它们都没有被接受(HttpServletRequest、WebRequest和ServerRequest)。
我可以使用什么类型来访问webflux带注释的处理程序方法中的原始请求?
发布于 2018-09-20 07:40:19
您应该使用org.springframework.http.server.reactive.ServerHttpRequest,因为:
HttpServletRequest和WebRequest是Servlet/Spring特有的ServerRequest属于Spring WebFlux,但是函数变体https://stackoverflow.com/questions/52409277
复制相似问题