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

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;
}
发布了94 篇原创文章 · 获赞 44 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/qq_43639296/article/details/102728194