其他分享
首页 > 其他分享> > Cannot call sendError() after the response has been committed

Cannot call sendError() after the response has been committed

作者:互联网

一个下载文件的方法,每次文件都能成功下载,但控制台总会报错:

    Cannot call sendError() after the response has been committed
    Could not find acceptable representation

虽然不妨碍下载功能的使用,但总报错让人心烦。
参考了这篇文章,原来是输出流关掉后还在return导致的。
去掉return,让方法返回void,错误消失。

标签:sendError,after,been,Cannot,报错,committed,call
来源: https://blog.csdn.net/hqqqqqqq555/article/details/99824728