Loop through array in ThymeLeaf -


i new thymeleaf , wondering if there way loop around

html tag iterate through array within

tag. want elements within smoketest end in different paragraphs.

<!doctype html> <html xmlns:th="http://www.thymeleaf.org"> <head>     <title>getting started: serving web content</title>     <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body>     <p th:text="${smoketests[0].name}" /> </body> </html> 

thanks help

did try following code? didn't test it, cause it's used :

<body>     <p th:each="smoketest : ${smoketests}"        th:text="${smoketest.name}">a smoke test</p> </body> 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -