在controller中写 @RequestMapping(中的params="json")

    @RequestMapping(value = "/{username}", params = "json")
    @ResponseBody
    public User showJson(@PathVariable String username, Model model) {
        return users.get(username);
    }

 

相关文章:

  • 2021-10-08
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2021-09-27
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-12
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
相关资源
相似解决方案