后端代码:
List<String> ls=starService.getAllFamousNames(); mav.addObject("famousNames", ls);
前端代码:
<ol> <li th:each="name:${famousNames}"> <span th:text="${name}"></span> </li> </ol>
显示效果:
END