@RestController class MyController { @RequestMapping(...) public void test(Container container) { ... } }
Spring by default uses Dot-Notation to deserialize the nested @RequestParam:
class Container { A a; } class A { String val; }
work with:
http:
But for cards, it uses a square bracket designation:
class Container { Map<String, String> a; }
work with:
http:
When using JavaScript there, of course, there is no difference between the HashMap and the embedded object, so everything will be serialized either with the squares of the square Dots brackets , or
Question:
How / where can I tell Spring (or Spring Boot, if it's easier) to use Dot-Notation (or square brackets) for
both , nested objects
and Maps?
Or is there a reason Spring makes a difference between these types?
source share