欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

There was an unexpected error (type=Internal Server Error, status=500). getWriter() has already been

程序员文章站 2022-05-29 16:04:57
...

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Oct 24 16:28:23 CST 2019
There was an unexpected error (type=Internal Server Error, status=500).
getWriter() has already been called for this response

//这么写会报以上的错误
//注意:response.getWriter()后无法进行@ResponseBody的响应操作

@RequestMapping("/result")
@ResponseBody
public String result(HttpServletRequest request,HttpServletResponse response){
	String returnDesc = "操作成功";
	response.getWriter().print(returnDesc);
	return returnDesc;
}