Repeatable Read input stream problem

In order to unify the signature, you need to read json input data stream before the controller,

controller parameter binding is read directly inputStream, but generally httpServletRequest can only be read once,

The solution is directly read in the filter buffer is then read inputStream a result, all subsequent InputStream.read () are taken from the buffer (including the binding parameters of the controller).

ContentCachingRequestWrapper this class inputSteam still only be read once, read-ahead caching results again need to call another way getContentAsByteArray (), parameter binding does not automatically call this getContentAsByteArray, to solve the above problems with this class is not enough

https://blog.csdn.net/bjo2008cn/article/details/53888923

https://blog.51cto.com/zero01/2334836

Guess you like

Origin www.cnblogs.com/yszzu/p/11616595.html