• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting started with beans

 
Tom Joiner
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am hoping to get rolling with beans, and if you have any links to any simple tutorials that would be a great help.

My first bean I am hoping to access a database, get a list of names of products, and then display these on a web page.

I assume I use a servlet to populate the bean, then call a web page with a "response" bean that is set up so the JSP can read out the values. Does this sound about right?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an EJB dimension to your question? Why did you post this in this forum?
 
Tom Joiner
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HOnestly because I thought EJB stood for "Enterprise Java Beans". Am I remiss in this understanding?

I am trying to make the leap into using beans for transferring data from Servlets to JSP pages.. and perhaps this is not the right forum for questions like that. Am I misunderstanding what EJB is?
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes and no. It depends on whether you actually need EJBs for your solution. Especially since it looks like just querying. The main thing you will get out of EJBs is transactions. There are more, but the question ends up coming down to "do you need the added services that EJBs give you, or are you fine with just Servlets and its security?"

Mark
 
Ådne Brunborg
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The term "bean" generally does not refer to an EJB. Read the Wikipedia article on JavaBeans for more.

Now, for learning EJB, try reading the JBoss EJB 3.0 Tutorial.

But I must say, using EJBs to move data between Servlets and JSP is just plain wrong. EJBs give you transaction handling and security. If you don't need it, don't use it.
[ November 15, 2006: Message edited by: �dne Brunborg ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!