This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "From servlet, to Bean to JSP" Watch "From servlet, to Bean to JSP" New topic
Author

From servlet, to Bean to JSP

Shuaib Gill
Ranch Hand

Joined: May 29, 2001
Posts: 62
Hi,
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,


programmer77
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: http://aspose.com/file-tools
 
subject: From servlet, to Bean to JSP
 
Similar Threads
How to stop entering data
retaining value in java script
Where to populate values for drop down box?
bundle, in one config file, web parameter names?
Combo box building