• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why JSP donot support Enumeration?

 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In My JSP i retrived a vector from my Bean and when I tried to retrive its values through Enumeration JSP did not show any result though if i did samething through servlet All the elements of Vector are retrived as well as displayed?
Can Any sheriff or JSP wizard tell the reason behind it?
Waiting...............
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So why aren't you using a LinkedList and an Iterator?
There is no reason why an Enumeration shouldn't work in a JSP.
------------------
Moderator of the JDBC Forum
[This message has been edited by Thomas Paul (edited February 22, 2001).]
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think we can help without seeing the JSP code involved.
 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
var flg = 0;
</SCRIPT>
<Title>
Hello
</Title>
</HEAD>
<%@ page language = "java" import="java.sql.*,java.io.*,java.util.*"%>
<%@ page errorPage="error.jsp" %>
<jsp:useBean id="b" class = "sunexamples.beans.ParseXML2" scope = "page" />
<BODY onLoad = "checkflag()">
<%!
int n,m,k,l;
String TaskId,Txcor,Tycor,TaskImg;
String ConId,Cxcor,Cycor,CImg;
String BId,Bxcor,Bycor,BImg;
String DId,Dxcor,Dycor,DImg;
%>
<%
b.PXML();
Vector vt = b.getTaskAttributes();
n = vt.size();
Enumeration enum = vt.elements();
System.out.println(vt);
while(enum.hasMoreElements())
{
Vector v = (Vector)enum.nextElement();
TaskId = v.elementAt(0).toString();
Txcor = v.elementAt(5).toString();
Tycor= v.elementAt(6).toString();
TaskImg= v.elementAt(7).toString();
%>
<div id=a style=position:absolute;left:<%= Txcor %>;top:<%= Tycor %>;>
<img src = <%= TaskImg %>></img>
<a href = "DeleteTask.jsp?TaskId=<%=TaskId%>">delete</a>
<a href = "UpdateTask.jsp?TaskId=<%=TaskId%>">Update</a>
</div>
<%
}
%>
</BODY>
</HTML>
This was the code which was not working with Enumeration
Originally posted by Tony Alicea:
I don't think we can help without seeing the JSP code involved.

 
Raghav Mathur
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't think that enumeration doesn't work on jsp ....
can you send me your code at rax_india@yahoo.com.
r u getting an error ?.....if yes , then send me the error also .
if util works on jsp then why can't enumeration work on it ..
dom write to me at rax_india@yahoo.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic