aspose file tools*
The moose likes Servlets and the fly likes Why JSP donot support Enumeration? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Why JSP donot support Enumeration?" Watch "Why JSP donot support Enumeration?" New topic
Author

Why JSP donot support Enumeration?

Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
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...............


SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
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).]


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
I don't think we can help without seeing the JSP code involved.


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
<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

Joined: Jan 12, 2001
Posts: 641
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

Raghav.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why JSP donot support Enumeration?