开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜