網站首頁 編程語言 正文
在編寫導出功能使用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-05-15 Python?OpenCV使用dlib進行多目標跟蹤詳解_python
- 2022-11-02 Python嵌套函數與nonlocal使用詳細介紹_python
- 2022-08-21 Android貝塞爾曲線實現加入購物車拋物線動畫_Android
- 2023-01-12 keepalived?+?nginx?實現高可用方案_nginx
- 2023-03-26 Kotlin?server多線程編程詳細講解_Android
- 2022-09-14 Android?實現卡片堆疊錢包管理動畫效果_Android
- 2022-12-09 C++使用標準庫實現事件和委托以及信號和槽機制_C 語言
- 2022-05-18 ASP.NET?MVC自定義異常過濾器_實用技巧
- 最近更新
-
- 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同步修改后的遠程分支