This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Do I need JavaBeans? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Do I need JavaBeans?" Watch "Do I need JavaBeans?" New topic

Do I need JavaBeans?

Subbu Aswathanarayan
Ranch Hand

Joined: Jun 22, 2001
Posts: 73
Hi all,
I web application has 6 servlets and 3 JSP pages, and all of these need to call the same function.should I implement this function as a bean?

Snylt Master
Ranch Hand

Joined: Jul 07, 2001
Posts: 55
Must depend on what sort of function your dealing with. Is it just a simple one then write the source in a jsp file and include it , on the other hand , if it's a complex one maybe javabean will do the trick!
Can anyone suggest from their own experience what you would have done... and why!
// Snylt Master

Preparing for the Java 2 Certification exam
Subbu Aswathanarayan
Ranch Hand

Joined: Jun 22, 2001
Posts: 73
Hi Snylt Master,
Yes, the function is indeed a simple one but all the servlets and JSP pages have to call it.what do u suggest now?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Why not just use a static method in a class that all servlets and JSP import?
I agree. Here's the link:
subject: Do I need JavaBeans?
jQuery in Action, 3rd edition