If you want to avoid scriptlet code, you can do this with the JSTL <c:forEach>
tag. For example, to print out each item as a sepate entry in an ordered list, use:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head></head>
<body>
<ol>
<c:forEach items="${vector}" var="item">
<li><c:out value="${currentName}" /></li>
</c:forEach>
</ol>
</body>
</html>
If you don't care about encoding currentName
, you can shorten this to:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head></head>
<body>
<ol>
<c:forEach items="${vector}" var="item">
<li>${currentName}</li>
</c:forEach>
</ol>
</body>
</html>