How to use method POST, with a complex Hashmap<Object,list<Object>>

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to use method POST, with a complex Hashmap<Object,list<Object>>

expectral
Hi !

When I use method POST with a form, I can't catch my complex Hashmap<Object,List<Object>> in my Controller (empty value)

<form id="myform" class=" form-horizontal" role="form"
          th:action="@{/myaction}"
          th:object="${MyObjectWithFieldsAndMyComplexHashMap}"
          th:method="POST">

I can catch "classic" HashMap<String, List<String>> in my Controller with this :

<input th:each="entry: ${MyObjectWithFieldsAndMyComplexHashMap.myComplexMap}" type="hidden" th:field="*{myComplexMap['__${entry.key}__']}" />


My complex Hashmap is like this :

Object -> I want load 2 attributes in this (name + description)
List -> In each Object, I want to load 2 attributes  (name + description)


Anyone can help me please ?

Thanks ;)