Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

having problem using for each  RSS feed

 
raji toor
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me to remove scriptlets from ths code. i just can't figure out how to display objects of type StaticIpData using \<c:forEach. please help.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi...



Try this code ..


<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="com.pack.useIP.*,java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>JSP Page</title>
</head> <body>
<h1>JSP Page</h1>
<c:forEach var ="al" items ="${iplist}">

<tr>
<td> ${al}</td>
</tr>

</c:forEach>

</body></html>
 
raji toor
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
respectively that is amazing the thing i had been trying all nigt worked in the morning.
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>JSP Page</h1>
<c:forEach var="abc" items="${sessionScope.iplist}">
<cut value="${abc.ipAsString}"/><br>
</c:forEach>
</body>
</html>
i think i was doing this only. Might had missed somthing.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!