我有這樣的代碼:Thymeleaf:重新分配一個局部變量
<div th:each="element : ${list}" th:with="test=false">
<div th:each="element2 : ${list2}">
<div th:if="element2.name == 'someName'">
<div th:with="test=true">test changed</div>
</div>
</div>
<div th:text="${test}"></div>
</div>
但是變量「測試」始終是始終爲false。我能做什麼?
可能重複的[Thymeleaf變量變量](http://stackoverflow.com/questions/22597604/thymeleaf-change-variable) –