iterators.jsp 708 B

12345678910111213141516171819202122232425
  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  2. <%@ include file="../../upper.jsp" %>
  3. <br>
  4. <h2>&lt;forEach&gt; Test</h2>
  5. <br>
  6. <form action="iterators.jsp" method="GET">
  7. input number you want to iterate( 0 < x <= 100 )<br>
  8. <input type="text" size="3" name="iterate" value="${param["iterate"]}">
  9. <input type="submit" value="submit">
  10. </form>
  11. <c:catch>
  12. <c:choose>
  13. <c:when test="${param.iterate > 0 && param.iterate <= 100}">
  14. <c:forEach var="i" begin="1" end="${param.iterate}">
  15. ${i} <br>
  16. </c:forEach>
  17. </c:when>
  18. <c:when test="${empty param.iterate}"></c:when>
  19. <c:otherwise> you have to input number 1 to 100 </c:otherwise>
  20. </c:choose>
  21. </c:catch>
  22. <%@ include file="../../footer.html" %>