Accessing scope variable to indexin map object in Thymeleaf
<p>I have a sequence of day, an a foreach scope in a thymeleaf template, and also a hashmap object. </p>

<p>I want to access, hashmap values by the scope variable, but I can't figure out how. This is my best try so far:</p>

<pre><code>      &lt;td th:each="day : ${DaySequence}" class="openable" th:attr="data-redir=@{/task/frame/{nbrplt}/{week}/{day_num}(nbrplt=${vehicle.numberPlate}, week=${week.weekNumber}, day_num=${day}) }"&gt;
                    &lt;ul&gt;
                      &lt;li th:each="task : ${vehicle.vehicleTaskByDays[day]}" th:text="${task.toString()}"&gt;&lt;/li&gt;
                      &lt;!-- &lt;li th:text="${day}"&gt;&lt;/li&gt; --&gt;
                    &lt;/ul&gt;
                  &lt;/td&gt;
</code></pre>

<p>But thyme leaf can't parse this. On some forum i found this as solution:</p>

<pre><code>  &lt;li th:each="task : ${vehicle.vehicleTaskByDays[__${day}__]}" th:text="${task.toString()}"&gt;&lt;/li&gt;
</code></pre>

<p>But it's does not work either, so how can i access the day variable between th "[ ]" ?</p>