【发布时间】:2021-07-16 03:40:02
【问题描述】:
我想创建一个JSONObject:
@RequestMapping(value = "/test", method = RequestMethod.GET)
@ResponseBody
public JSONObject Test() {
JSONObject test = new JSONObject();
test.put("name","caroline");
return test;
}
结果给了我:
{"map":{"name":"caroline"}}
但我一直在等待这样的事情:
{"name":"caroline"}
不知道问题出在哪里,我就关注了this exemple
【问题讨论】:
标签: spring-boot