<button type="submit" action="display_fiche" class="waves-effect waves-light btn">
Afficher la fiche
</button>
创建隐藏输入以保留单击的id。
但似乎你不需要这么复杂的方式
form
和
post
. 用普通的就够了
<a>
<a href="/display_fiche/${fiche.id}" class="waves-effect waves-light btn">
Afficher la fiche
</a>
和控制器
@RequestMapping(value="/display_fiche/{id}", method = RequestMethod.GET)
private ModelAndView displayFiche(@PathVariable("id") Long id, ModelMap modelMap) {
System.out.println("Fiche séléctionnée : " + id);
return model;
}