问题:
java.lang.IllegalStateException: cannot resize buffer, 305 bytes have been written (Servlet 2.3, sec. 5.1)
具体情况:
过滤器dofilter方法中调用response.sendredirect()后报错: java.lang.IllegalStateException: cannot resize buffer, 305 bytes have been written (Servlet 2.3, sec. 5.1)
曾用办法:在什么目标页上加上<%@ page buffer="512kb"%>,结果还是不行;
结果发现是转发之后,没有立即返回,而让过滤器链继续倒致的错误。
解决办法:
调用response.sendredirect()之后,不能再调用filterchain.doFilter(req, res);
加一个if()else()就OK了。
java.lang.IllegalStateException: cannot resize buffer, 305 bytes have been written (Servlet 2.3, sec. 5.1)
最新推荐文章于 2024-04-27 01:01:09 发布