浏览 3117 次
该帖已经被评为隐藏帖
|
|
---|---|
作者 | 正文 |
发表时间:2009-10-26
最后修改:2009-10-26
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; req = getServletRequest(req); chain.doFilter(req, response); } private HttpServletRequest getServletRequest( final HttpServletRequest pRequest) { return new HttpServletRequestWrapper(pRequest) { public int getContentLength() { return -1; } public ServletInputStream getInputStream() throws IOException { final InputStream in = new GZIPInputStream(pRequest .getInputStream()); return new ServletInputStream() { public int read() throws IOException { return in.read(); } public void close() throws IOException { in.close(); } }; } public BufferedReader getReader() throws IOException { return new BufferedReader(new InputStreamReader( getInputStream(), "UTF-8")); } }; } 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |