表单/json
int 字段 写成string、
@RequestMapping(value = "/typeError",produces = "application/json;charset=utf-8")
public String typeError(@RequestBody String str){
JSONObject obj = JSONObject.parseObject(str);
try {
obj.getIntValue("age");
} catch (Exception e) {
// e.printStackTrace(); // For input string: "1s1"
return "type error";
}
return obj.toJSONString();
}