• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

items are not displayed in c:forEach

 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given here is my jsp file

<%@ page import="java.util.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>
</head>
<body>
<%
int [] arr1 = {124,25235,5236234,36346};
ArrayList al = new ArrayList();
al.add("senthil");
al.add("Azhar");
al.add("sachin");
al.add(new Integer(6));
%>


<c:forEach var="member" items="${arr1}" varStatus="cnt" begin="0" step="1">
${cnt.count} value is : ${member}
</c:forEach>

</body>
</html>

Be it the ArrayList or the Array whatever i gave inside the items attribute,nothing gets displayed.empty page is shown.No exception is thrown.

what is the mistake in the forEach action.
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks it is working now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic