• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Having trouble getting Vector out of a bean in JSP

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic