zoukankan      html  css  js  c++  java
  • getOutputStream() has already been called for this response的解决方法

    1.问题描述:spring mvc中下载文件结束后,跳转到list页面,问题报上面的异常。

    2.原因:写文件的时候response调用一次,在跳转的时候,spring调用ActionForward类中也有response,两个response有冲突。

    3.解决方法:下载文件结束后不要跳转,直接return null;就行了。或者重写stream,方法如下:

    protected void initStreams() {
    // Replace System.out and System.err with a custom PrintStream
    System.setOut(new SystemLogHandler(System.out));
    System.setErr(new SystemLogHandler(System.err));
    }

  • 相关阅读:
    第30周日
    第30周六
    第30周五
    第30周四
    第30周三
    第30周二
    第30周一
    第29周日
    软件架构学习小结
    数据挖掘十大经典算法
  • 原文地址:https://www.cnblogs.com/nizuimeiabc1/p/6346772.html
Copyright © 2011-2022 走看看