小编gma*_*oor的帖子

如何过滤百里香的集合:每个使用另一个属性进行比较

我试图通过以下url中的示例使用Thymeleaf过滤集合."投影和选择收集"部分. http://doanduyhai.wordpress.com/2012/04/14/spring-mvc-part-iv-thymeleaf-advanced-usage/

<tr th:each="artist,rowStat : ${listArtits.?[alive == true]}">
...
</tr>
Run Code Online (Sandbox Code Playgroud)

但是我想使用另一个属性而不是固定值(true/false).例如

<tr th:each="artist,rowStat : ${listArtits.?[played > playedCountReq]}">
...
</tr>
Run Code Online (Sandbox Code Playgroud)

其中,playingCountReq是Thymeleaf可用的另一种形式变量.我收到以下错误.在类型的对象上找不到属性或字段'playingCountReq'...

我试过多种方法但没有成功.有什么建议?

html spring-mvc spring-el thymeleaf

6
推荐指数
2
解决办法
8843
查看次数

标签 统计

html ×1

spring-el ×1

spring-mvc ×1

thymeleaf ×1