It is possible but you need to rebuild your template little bit. Because th:include
is processed before th:each
you need wrap div
with th:include
to iteration tag. Also path to template must be String
so you can't do modules/$module.key
as it's not produce desired result I suppose. See example below.
<th:block th:each="module : ${report.modules}">
<div th:include="${#strings.concat('modules/', module.key)} :: ${module.key}"></div>
</th:block>