如何在百里香中循环 1 到 5? [英] How to loop through 1 to 5 in thymeleaf?

查看:24
本文介绍了如何在百里香中循环 1 到 5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在thymeleaf中循环1到5,类似jsp代码:

I want to loop through 1 to 5 in the thymeleaf, similar to jsp code:

<c: forEach begin = "1" end = "5" varStatus = "V"> </ c: forEach>.

推荐答案

<th:block th:each="i: ${#numbers.sequence(1, 5)}"></th:block>

这篇关于如何在百里香中循环 1 到 5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆