public final class StandardEachAttrProcessor extends AbstractStandardIterationAttrProcessor
<tr th:each="prod : ${prods}">
<td th:text="${prod.name}">Product name</td>
<td th:text="${prod.price}">Product price</td>
</tr>
That "prod : ${prods}" attribute value you see above means "for each element in the result of evaluating ${prods}, repeat this fragment of template setting that element into a variable called prod".
A collection can be any java.util.Iterable, a java.util.Map (iteration variables will be a java.util.Map.Entry), or an array.
AbstractIterationAttrProcessor.IterationSpec, AbstractIterationAttrProcessor.StatusVar
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_NAME |
static int |
ATTR_PRECEDENCE |
DEFAULT_STATUS_VAR_SUFFIX
Constructor and Description |
---|
StandardEachAttrProcessor() |
Modifier and Type | Method and Description |
---|---|
int |
getPrecedence() |
getIterationSpec, processClonedHostIterationElement
processAttribute
doProcess, getMatcher
compareTo, getMessage, getMessageForProcessor, getMessageForTemplate, process
public static final int ATTR_PRECEDENCE
public static final String ATTR_NAME
public int getPrecedence()
getPrecedence
in class AbstractProcessor
Copyright © 2017 The THYMELEAF team. All rights reserved.