0
我是新的thymeleaf和春季启动,所以我真的不知道我在寻找什么来解决我的问题。 我有几个用户在我的网站列表中显示。当我点击其中一个用户时,我想显示用户个人资料页面。百里香显示特定的用户配置文件
名单如下:
<ul>
<li th:each="section : ${sections}">
<a href="overviewDivision.html?id=1" th:href="@{/overviewDivision?id=1}">
<span th:text="${section.name}">Bereich3</span>
</a>
<ul>
<li th:each="person : ${personSectionService.getPersonsBySectionId(section.id)}">
<a href="overviewEmployee.html?id= + person.id" th:href="@{/overviewEmployee?id= + person.id}">
<span th:text="${person.firstName + ' ' + person.lastName}">
</span>
</a>
</li>
</ul>
</li>
</ul>
这是我的控制器:
@RequestMapping(value = "/overviewEmployee", method = RequestMethod.GET)
public String overviewEmployee(Model model) {
model.addAttribute("sections", sectionService.getAllSections());
model.addAttribute("personSectionService", personSectionService);
model.addAttribute("currentPerson", personService.getById(1));
return "overviewEmployee";
}
在我使用currentPerson.firstName等,以获取有关用户的信息的个人资料页面。 所以我的问题是,如何将currentPerson更改为列表中最后点击的人?或者我是否完全错误?