File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes From servlet, to Bean to JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "From servlet, to Bean to JSP" Watch "From servlet, to Bean to JSP" New topic

From servlet, to Bean to JSP

Shuaib Gill
Ranch Hand

Joined: May 29, 2001
Posts: 62
Suppose I have opened a db connection , executed and SQL query and I have 3 fields. Now suppose I want to put the values of these 3 fields into a Java Bean (not EJB). From there I want to put the values of the database query on the JSP page. How can this be done?
Thanks in advance,

Vlad Patryshev
Ranch Hand

Joined: Jun 30, 2001
Posts: 61
You have a resultset; get the column values then. Set the bean attributes to the values you have: myBean.setAttributeNumber1(theValue). Retrieve the bean attributes and place them to the page, like this: <%= myBean.getAttributeNumber1() %>

Thanks,<br />Vlad
I agree. Here's the link:
subject: From servlet, to Bean to JSP
jQuery in Action, 3rd edition