File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Why JSP donot support Enumeration?" Watch "Why JSP donot support Enumeration?" New topic

Why JSP donot support Enumeration?

Gaurav Chikara
Ranch Hand

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

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

Joined: Jan 30, 2000
Posts: 3222
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
var flg = 0;
<%@ page language = "java" import="java.sql.*,*,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;
Vector vt = b.getTaskAttributes();
n = vt.size();
Enumeration enum = vt.elements();
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>
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
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

I agree. Here's the link:
subject: Why JSP donot support Enumeration?