@RequestMapping("/hello")
public String hello() {
return "你好";
}
@RequestMapping("/hello2")
public Object hello2() {
return "你好";
}
@RequestMapping("/hello3")
public Object hello3() {
List<String> list = new ArrayList<>();
list.add("你好");
return list;
}
@RequestMapping("/hello4")
public String hello4() {
return JSON.toJSONString("你好");
}
除了hello3均乱码
解决方法:
在类注解上修改
@RequestMapping(value = "/debug", produces="text/html; charset=UTF-8")