• Post Reply Bookmark Topic Watch Topic
  • New Topic

Having trouble getting Vector out of a bean in JSP  RSS feed

 
Michael Greifenkamp
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there.
I have a servlet that populates a bean, using Enumeration and a Vector, with information from a database. The servlet then starts a JSP. I would like the JSP to then print out the information in the bean into the browser.
I've imported java.sql.* and java.util.* at the start of the jsp, and then:
<jsp:useBean id = "infobean" class="MikeBean"/>
<html><body>
<%
private Vector infobean = new Vector();
{
for (Enumeration e = infobean.elements();e.hasMoreElements() {
out.println((String) e.nextElement() + " ");
}
%>
</body></html>
I'm TOTALLY new to this stuff and all I did was copy the output method from the MikeBean java file.
Thanks in advance for any help.
Mike
 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What was the problem, can you be more specific? What was the scope of the bean? Was it session or page?
 
Michael Greifenkamp
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I posted prematurely--apparently I have several problems.
One of our programmers here at work is messing with it now (thank goodness). I'll repost if he can't figure out what is going on.
Thanks!!!
Mike
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!