4

We have a Schema like this:

SchemaChild of type Embedded with two fields; A (text) and B (text)

SchemaParent of type Content with one Field C (SchemaChild) as a multi-value field.

How can I iterate in DD4T Java to read all values and print in <tr> and <td> tags?

1 Answer 1

3
  1. SchemaChild:

    private String fieldA;     
    private String fieldB;
    

Generate getters and setters.

  1. SchemaParent

    private List<SchemaChild> fieldC;

again generate getter setter etc.

In view, read the values like:

<c:forEach var="item" items="${entity.fieldC}">
${item.fieldA}
${item.fieldB}
</c:forEach>

where entity points to SchemaParent

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.