The JavaServer Pages Standard Tag Library (JSTL) provides a better separation between HTML code and dynamic content. It encapsulates iterative or conditional processing, XML transformation, accessing datasources and localization.
Useful JSTL and Non-JSTL Tag-Libs are:
- Conditional or iterative processing: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- XML tranformation: <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
- e.g. date format or localization: <%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<body>
<ul>
<c:forEach var="orderItem" items="${sessionScope.ORDERS}">
<li>${orderItem.name}</li>
<li>${orderItem.amount}</li>
<li>${orderItem.singlePrice}</li>
</c:forEach>
</body>
</html>
RegardsRafael
