Programmatically change http response status using spring 3 restful

前端 未结 4 1277
伪装坚强ぢ
伪装坚强ぢ 2021-01-12 15:46

I have a controller like below

@Controller(\"myController\")
@RequestMapping(\"api\")
public class MyController {

     @RequestMapping(method = RequestMetho         


        
4条回答
  •  长发绾君心
    2021-01-12 16:22

    You need to change the type of the output value ResponseEntity. Answer here: How to respond with HTTP 400 error in a Spring MVC @ResponseBody method returning String?

提交回复
热议问题