How to convert Thymeleaf data types?

when traversing an array using Thymelaf loops in hmlt

<div th:each="c : ${blog.categories}">
    <span  class="label label-primary" th:text="${c}"></span>
</div>

the display on the page is as follows

clipboard.png

because here ${blog.categories} is a string rather than an array object! In JS, JSON.parse () is fine, but how to solve this problem?

Mar.23,2021
Menu