SSH中发生异常java.lang.IllegalStateException: getOutputStream() has already been called for this response

    下载文件的时候发生异常!

       java.lang.IllegalStateException: getOutputStream() has already been called for this response

    response这个对象是Servlet自己管理的,之所以出现上面的错误: 

          1.几乎都说与Output之类其他的输出流相互排斥了。 
          2.Struts方法之间调用引起的。 

     因为:每个方法都返回的是一个ActionForward对象,而response是ActionForward对象参数,所以就会使response冲突! 

    在实际的例子中,需要在最后返回null就可以的了。

   SSH中发生异常java.lang.IllegalStateException: getOutputStream() has already been called for this response_第1张图片

你可能感兴趣的:(SSH中发生异常java.lang.IllegalStateException: getOutputStream() has already been called for this response)