I got strange error, which cannot access thymeleaf variable on child element, top one works but second one gets error.
I think second child gets error because of th:each, How can I fix this? Here's error line. Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method getAdminList() on null context object
<li
class="setting"
th:each="category : ${categories}"
th:id="|category${category.getId()}|" <- works
>
<div class="setting_top">
<div class="setting_img_frame">
<img th:src="@{/images/{img}(img = ${category.getImg()})}" alt="" /> <- works
</div>
<div class="setting_right">
<div class="setting_right_top"></div>
<div class="setting_right_bottom" th:text="${category.getAbout()}"></div> <- also works..
</div>
</div>
<div class="setting_bottom">
<li
class="setting_tag"
th:each="admin : ${category.getAdminList()}" <- Error here, category does not exist
th:text="${admin}"
th:title="${admin}"
></li>
</div>
</li>
- ...
`. Do the same with the outer `