Thymeleaf
简介上下文数据获取 常用上下文获取 12345678910111213141516<!-- html页面取值. [[1, 2, 3]]再js中容易导致渲染出错,可在中间加空格,如 [ [1, 2, 3] ] -->[[${myVar}]]<!-- 获取url参数 --><span th:text="${#httpServletRequest.getParameter('roleCode')}">这里的文字会被替换</span><!-- 定义变量并取值 --><div th:with="curPage=${#httpServletRequest.getParameter('page')}"> <h3>当前页码:<span th:text="${curPage}"></span></h3></div><!-- 被|包裹的变量会转换后和字符串进行拼接。@{...}为链接表达式 --><a href="" th:href="@{|/user/${user.id}|}">链接地址</a& ...