thymeleaf 使用th:utext 拼接后台传的两个动态参数

一、数据拼接显示:文本链接:用“+”符号,也可以用“|”符号。

 eg: 

    th:utext="|${cmenu.menuName}(${count})|"

    th:utext="${cmenu.menuName}+'('+${count}+')'"

二、th:action字符串拼接

   若user.userId=1,解析结果为:<form action="/user/1"></form>

<form th:action="@{'/user/'+${user.userId}}"></form>
<form th:action="@{/user/{userId}(userId=${user.userId})}"></form>

 


版权声明:本文为Jasyca503原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。