File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Doubt in using bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Doubt in using bean " Watch "Doubt in using bean " New topic

Doubt in using bean

veeramani velayutham

Joined: Dec 10, 2004
Posts: 11
When we go for bean and when we go for simple java class, which have only business logic
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
As used in servlets and JSP, a JavaBean is just a Java class that follows certain naming and access conventions which let you take shortcuts in JSP page code. If you don't want to use those shortcuts, don't use bean conventions.
In any helper class - bean or non-bean - you just need to keep in mind the scope of the object as related to the multi-threaded nature of web applications.
gudla Dathathreya Reddy

Joined: May 05, 2004
Posts: 15
Beans are used especially when you want to hold some data and this data can be transmitted from business layer to presentation or database layer to business layer etc. Most cases to hold data use bean. At the same time beans are some type of Java classes with some convention rule such as it should have a constructor with zero arguments, data member and setter, getter methods.
When you come accross to use a java class it can be use for any activities apart from holding data.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

Java beans are very important with respect to JSP since many of the JSP mechanisms, be they JSP actions that operate upon data or the new Expression Language (EL), expect data to be bean-patterned. Non-bean-patterned data just won't work well with these mechanisms.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Doubt in using bean
It's not a secret anymore!