how to create thymeleaf for-loop like java?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to create thymeleaf for-loop like java?

shuan

0
down vote
favorite
java for loop

int counter=10;
for(int i=1; i<=10; i++}{
  System.out.print(i);
}
thymleaf for loop

th:each="i:*{#numbers.sequence( 1, counter)}"
if counter=10, they all give 1,2,3...8,9,10 if counter=0; java loop will not print anything, but thymeleaf loop result as: 1,0.

How to create a for loop like java one in thymeleaf?

Loading...