下载文件时controller方法只能返回null或者void

下载前端:

<a  th:href="@{'/xx/download/'+${url}}" th:text = "${url}" ></a>

https://bbs.csdn.net/topics/391863898

controller添加返回值json后报错。

结论:下载文件时controller方法只能返回null或者void。

原因:因为response已经输出了,无论你返回不返回都没啥用了

下载方法见:https://blog.csdn.net/xinyuebaihe/article/details/88252390

猜你喜欢

转载自blog.csdn.net/xinyuebaihe/article/details/88665768