File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes items are not displayed in c:forEach Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "items are not displayed in c:forEach" Watch "items are not displayed in c:forEach" New topic
Author

items are not displayed in c:forEach

Senthil Kumar
Ranch Hand

Joined: Mar 13, 2006
Posts: 264
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.


when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
Senthil Kumar
Ranch Hand

Joined: Mar 13, 2006
Posts: 264
thanks it is working now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: items are not displayed in c:forEach