網站首頁 編程語言 正文
在編寫導出功能使用action請求,在處理導出異常時期望跳轉異常頁,Controller中的方法返回類型String的url
在處理完邏輯導出文件后后臺控制臺出現
WARN? [org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver] (default task-22) Handling of [org.springframework.http.converter.HttpMessageNotWritableException] resulted in Exception: java.lang.IllegalStateException: UT010019: Response already commited
and
ERROR [io.undertow.request] (default task-22) UT005023: Exception handling request to /snq-admin/data/exportDataDetail.do: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: UT010029: Stream is closed; nested exception is java.io.IOException: UT010029: Stream is closed
Caused by: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: UT010029: Stream is closed; nested exception is java.io.IOException: UT010029: Stream is closed
Caused by: java.io.IOException: UT010029: Stream is closed
在寫入文件時調用requestOutputStream.write()方法已將response發出,再在Controller中return時被認為是再發送一次,因而會報錯,解決這個問題只需返回null即可。
原文鏈接:https://blog.csdn.net/qq_18671415/article/details/120915945
相關推薦
- 2022-07-17 JDK、JRE、JVM是什么?有什么區別?
- 2022-09-24 詳解K8S?apiVersion對照表_云其它
- 2022-10-19 報錯No?module?named?numpy問題的解決辦法_python
- 2022-04-17 SpringBoot中,redis的key和value為基本類型時需要注意的
- 2021-12-06 ASP.NET?Core使用固定窗口限流_實用技巧
- 2022-10-07 Android?線程優化知識點學習_Android
- 2022-04-24 C語言的abs()函數和div()函數你了解嗎_C 語言
- 2022-12-15 Python?OpenCV中cv2.minAreaRect實例解析_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支