• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

items are not displayed in c:forEach

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks it is working now
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic