U
U.O
I can't understand how <forEach> is supposed to work. This code iterates
once (why?) and produces only one string, "Item" (without the index number).
Why?
<jsp:root version="1.2"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<jsp:directive.page contentType="text/html; charset=UTF-8" session="true"
/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
<title>Blah</title>
</head>
<body>
<div>
<c:forEach var="i" start="1" end="10">
Item ${i}<br />
</c:forEach>
</div>
</body>
</html>
</jsp:root>
once (why?) and produces only one string, "Item" (without the index number).
Why?
<jsp:root version="1.2"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
<jsputput doctype-root-element="html" omit-xml-declaration="false"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<jsp:directive.page contentType="text/html; charset=UTF-8" session="true"
/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
<title>Blah</title>
</head>
<body>
<div>
<c:forEach var="i" start="1" end="10">
Item ${i}<br />
</c:forEach>
</div>
</body>
</html>
</jsp:root>