问题描述: Thymeleaf模板里想要调用url上的参数
url:http://localhost:8081/index?pageNo=0&size=15&keyword=%E6%B4%97%E8%A1%A3%E6%9C%BA&sort=price
下面展示如何使用sort参数:
代码:
<div class="sort" th:with="text=${param.sort==null?null:param.sort[0]}">
<a th:href="@{'/index?pageNo=0&size=15&keyword='+${keyword}}" title="按默认排序"
th:classappend="${text == null}?'on':''">默认</a>
<a th:href="@{'/index?pageNo=0&size=15&keyword='+${keyword}+'&sort=discussCount'}"
title="按评论数从高到低排序" class=""
th:classappend="