在 @RequestMapping 上添加 produces={"text/plain;charset=UTF-8"} 属性,之后就变成这样的:
@RequestMapping( value = "xxx", method = {RequestMethod.POST}, produces={"text/plain;charset=UTF-8"} )
此属性可以理解为:此处理方法将生成这个类型的数据,此时根据请求头中的Accept进行匹配,如请求头 “text/plain;charset=UTF-8” 时即可匹配。
博客介绍在Java的@RequestMapping上添加produces={\text/plain;charset=UTF-8\}属性,该属性表示处理方法将生成此类型数据,会根据请求头中的Accept进行匹配,如请求头为 “text/plain;charset=UTF-8” 时可匹配。

5709

被折叠的 条评论
为什么被折叠?



