passedbylove

需求:

相关class类名:S224_on_point

url:/notification/list

 

 url:/notification/list?type=2

 

thymeleaf代码如下:

<div th:classappend="${(param.isEmpty() ? \'S224_on_point \' : \'\') + \'S224_message_kind pageChange\'}" th:attr="data-page=@{/notification/list}">全部消息</div>
                <div th:classappend="${(#strings.equals(#request.getParameter(\'type\'),\'1\') ? \'S224_on_point \' : \'\') + \'S224_message_kind pageChange\'}" th:attr="data-page=@{/notification/list(type=1)}">平台动态</div>
                <div th:classappend="${(#strings.equals(#request.getParameter(\'type\'),\'2\') ? \'S224_on_point \' : \'\') + \'S224_message_kind pageChange\'}" th:attr="data-page=@{/notification/list(type=2)}">产品消息</div>
                <div th:classappend="${(#strings.equals(#request.getParameter(\'type\'),\'3\') ? \'S224_on_point \' : \'\') + \'S224_message_kind pageChange\'}" th:attr="data-page=@{/notification/list(type=3)}">财务消息</div>
                <div th:classappend="${(#strings.equals(#request.getParameter(\'type\'),\'4\') ? \'S224_on_point \' : \'\') + \'S224_message_kind pageChange\'}" th:attr="data-page=@{/notification/list(type=4)}">用量消息</div>

thymeleaf中${param.xx}返回的是数组,这一点和jstl不一样,所以此次使用#request.getParameter(\'type\')

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-10-03
  • 2022-12-23
  • 2021-08-13
猜你喜欢
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2021-08-06
  • 2021-04-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案