No, the Map object of a wrapper DTO cannot be converted with POST: @ModelAttribute.
The @ModelAttribute annotation is used to bind the incoming HTTP request to a Java object. However, @ModelAttribute only supports binding of simple Java bean properties and cannot directly bind wrapper classes like Map.
To bind the Map object of a wrapper DTO, one can use @RequestBody annotation and pass the JSON data in the request body as a string. In the controller, the JSON data can be deserialized into the Map object using a JSON parsing library like Jackson or Gson.
Asked: 2023-07-07 17:33:41 +0000
Seen: 10 times
Last updated: Jul 07 '23