getWriter() has already been called for this response的问题

getWriter() has already been called for this response的问题
getOutPutStram() has already been called for this response的问题

一:使用HttpServletResponse.reset()方法 重置response头部内容解决

二:注意有没有同时调用 getWriter()和getOutPutStram()方法。
我出现的问题就是在filter里使用了getOutPutStram()方法,但当请求继续跑到action里的时候,action里使用了getWriter()方法。
所以一般注意好条件判断后,再使用getWriter()或者getOutPutStram()就好

你可能感兴趣的:(java基础)