Prevent response in controller

后端 未结 2 2046
感动是毒
感动是毒 2021-01-16 12:29

I am using spring boot to make a mock of one of our more complicated services. While all of the standard cases are easily done there is one that is causing me some troubles.

2条回答
  •  半阙折子戏
    2021-01-16 13:23

    You can create method like this:

    @ResponseBody
    @RequestMapping("/your-url")
    public String test() {
        return null;
    }
    

    you can also change @Controller to @RestController and remove the @ResponseBody

提交回复
热议问题