themleaf中th:href传入动态参数

匿名 (未验证) 提交于 2019-12-03 00:27:02

HTML中th:href的格式用法:

<a th:href="@{'/pageController?pageNum='+${pageNum}}" th:text="${pageNum}"></a>

格式:th:href="@{'字符串'+${model中的nam值}}"。

Controller中获取值:

@RequestMapping(value = "/pageController",method = RequestMethod.GET)     public String pageController(Model model, HttpServletRequest request){         String pageNum = request.getParameter("pageNum");

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!