Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果使用了了Thymeleaf模板引擎,在加载后台时会报错 #89

Open
gantrylau opened this issue Sep 19, 2023 · 1 comment
Open

Comments

@gantrylau
Copy link

gantrylau commented Sep 19, 2023

magic-api: 2.1.1
jdk: 17
springboot: 2.7.15

image

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: getOutputStream() has already been called for this response] with root cause
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:572)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:189)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:108)
at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:364)
at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:190)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1406)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1150)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:529)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)

@nownew
Copy link

nownew commented Nov 26, 2023

有人已经提供了解决方案,添加@responsebody可屏蔽此错误消息:
@RequestMapping(value = "/config-js")
@responsebody
@Valid(requireLogin = false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants