httpServletRequest

HttpServletRequest getParameter() missing parameter problem

Background Implemented a basic component can intercept all http requests, the request header/parameter/body/response, etc. for printout. Here the most critical and most difficult to deal with is the output of the body, because the transmission of characters in the body is obtained through the HttpServletRequest byte stream getInputStream (); and this byte stream does not exist after reading once. For example, the use of open source frameworks such as Spring some links have been intercepted to read the input stream, that after our custom interceptor to intercept the print body, the InputStream has no bytes … The implementation of the idea is not difficult, is their own inheritance to achieve HttpServletRequestWrapper, a copy of the body to save a good, and then in the Filter chain transfer can be.