0

I'm having some difficulties to populate back my map (HashMap<String, ArrayList<CustomObject>>) from my jsp.

I can access the map in my jsp and iterate on it to get the different values, but as soon as I submit this values I don't retrieve it as a HashMap<String, ArrayList<CustomObject>> like it should be, but as a HashMap<String, string representation of the list object>.

Here is a code sample of the jsp :

<s:iterator value="daysOfWeek" var="jour" status="stat">
    <s:iterator value="%{plageRecords[#stat.index]}" var="plage" status="innerStat">
        <s:select name="plageRecords[%{#stat.index+']['+#innerStat.index}].heureDebut" 
                  list="startHourList"/>
    </s:iterator>
</s:iterator>
Rémi Hirtz
  • 113
  • 3
  • 14
  • How the `plageRecords` looks like in your action? Maybe relevant [Struts2: Updating the values of a “List Of Objects” inside a Map](https://stackoverflow.com/q/15006868/1700321) – Aleksandr M Nov 15 '17 at 15:06
  • plagreRecords was an HashMap> with a few elements that I was ab le to display in the jsp. I changed it to HashMap accordingly to the link you gave me, but I'm still not getting anything in my action after submit – Rémi Hirtz Nov 16 '17 at 10:15
  • It should be `plageRecords['map_key']['list_index']`. This is very strange `+']['+`. :) – Aleksandr M Nov 16 '17 at 15:35
  • Yes I already changed it. I agrea it was a really wierd way to proceed, I just did this way because my code editor was giving me errors otherwise – Rémi Hirtz Nov 16 '17 at 23:20

0 Answers0