java - How to display on Web-page elements of sub-collection for chosen collection item? -
java - How to display on Web-page elements of sub-collection for chosen collection item? -
can give thought how display on web-page elements of subcollection choosen collection item? illustration collection element vegetables correspond carrots, tomatoes, onions etc. in words contains types of product, each element of collection correspond elements in collection b. there standard components or solutions?
use jstl tags. here quick reference guide started , and here example:
<c:foreach items="${vegetables}" var="vegetable"> <c:foreach items="${vegetable.carrots}" var="carrot"> <ul> <li>${carrot.color}</li> <li>${carrot.size}</li> <li>${carrot.somethingelse}</li> </ul> </c:foreach> <c:foreach items="${vegetable.tomatoes}" var="tomatoe"> <ul> <li>${tomatoe.color}</li> <li>${tomatoe.size}</li> <li>${tomatoe.somethingelse}</li> </ul> </c:foreach> <c:foreach items="${vegetable.onions}" var="onion"> <ul> <li>${onion.color}</li> <li>${onion.size}</li> <li>${onion.somethingelse}</li> </ul> </c:foreach> </c:foreach>
java jsp web
Comments
Post a Comment