【发布时间】:2018-12-18 14:02:43
【问题描述】:
我对春天很陌生。从我的控制器中,我得到了一个列表输出。
[[Article@42e72033 id = 1, title = 'Hello', description = 'Description', author = 'eeee'], [Article@7702e860 id = 2, title = 'Hello', description = 'Description', author = 'eeee'], [Article@3c2731ff id = 3, title = 'Hello', description = 'Description', author = 'eeee'], [Article@157e7973 id = 4, title = 'qqqq', description = 'qqqqq', author = 'qqqqq']]
我想在我的文章/view.html 中使用标题、描述和作者,目前看起来像这样:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
<body>
<table id="vets" class="table table-striped">
<thead>
<tr>
<th style="width: 150px;">Title</th>
<th>Description</th>
<th style="width: 120px">Author</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</body>
</html>
如何从列表中获取值并显示在正文部分?
【问题讨论】:
标签: java spring-boot spring-mvc model-view-controller