You can not use @RequestBody
twice at same request as there is only one. I guess you have an object called user with the fieldes as your json. You should change the method signiture to validateItems(@RequestBody User user)
And your json to user:{... Fieldes and values}
Create a Model class with parameters and pass the Model through the @RequestBody
Controller
@PostMapping(value = "/signin")
@ResponseBody
public String something(@RequestBody Model myModel)
{
return "";
}
Model
class Model {
private String param1;
private String param2;
Model() {}
Model(String param1, String param2) {
this.param1 = param1;
this.param2 = param2;
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.