由于jsp container在处理完成请求后会调用releasePageContet方法释放所用的PageContext object,并且同时调用getWriter方法,由于getWriter方法与在jsp页面中使用流相关的getOutputStream方法冲突,所以会造成这种异常,解决办法是:
只需要在jsp页面的最后加上两条语句:
out.clear();
out=pageContext.pushBody();即可(其中out,pageContext均为jsp内置对象!)getOutputStream() has already been called for this response] with root cause
getOutputStream() has already been called for this response] with root cause
最新推荐文章于 2023-04-06 15:20:01 发布