How to disply data from the database through Java Beans--Help Please

I am making an online shopping web site. Its a toy store. I have made a Java bean named toy(toyID, name, price, description, ImageId).

There is one more class which have functions of getting the toy from the data base.

Now I want to show all the toys with images on page .i.e Catalog.

Can anyone please tell me how do I take data from the database and using beans How do I display it on the page.

I hope my question is clear.

I know that it is possible for us to directly take data from the database and display it on the page. But I want to display through Java beans how do I do that,

Can any one tell me the flow...

please help...

Message was edited by:

aniketh_parmar

[733 byte] By [aniketh_parmara] at [2007-11-27 1:30:14]
# 1
http://java.sun.com/javaee/5/docs/tutorial/doc/Check halfway chapter 4, "Javabean components".It's straightforward: define a usebean, load the data using getToys() which returns List<Toy> from the database and then in the JSP use c:foreach to iterate through this
BalusCa at 2007-7-12 0:31:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Can u give me any other solution than tags for displaying data. Currently I am not very much familiar with tags, so I don't want to use it in my code.Thanks in advance
aniketh_parmara at 2007-7-12 0:31:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

> I am not very much familiar with tags, so I don't want to use it in my code.

Weird reasoning. I should say: just learn it? :)

There are two other main ways: using the MVC pattern (Struts, JSF, etc) or just doing it dirty with the whole code stuff in one large JSP page.

Well, I'm afraid you're just ended up in here.

BalusCa at 2007-7-12 0:31:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...