How can I check the http response status code in a Spring Interceptor?
It seems that the HttpServletResponse
parameter passed to HandlerInterceptor#postHandle
is write only: there is no getStatus()
method there.
Any idea about how to find out which HttpStatus
was set after the request?
Do you need this for unit testing? If so, just use MockHttpServletResponse, in which getStatus() is defined.
精彩评论