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

java bean..

eswar kumar
Ranch Hand

Joined: Oct 20, 2002
Posts: 98
what is the exact purpose of java bean in JSP?
Soman Singh
Ranch Hand

Joined: Sep 02, 2003
Posts: 37
I guess its the resuability of the code ie the bean. You can use it again and again without changing the class every time .. just adding the getter and setter solves the purpose ..
Its easy to use also.
Malhar Barai
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
You would come across MVC framework in many books.
This framework specifies :
Bean - Model
JSP/Swing - View
Servlet - Controller
Bean contains all the business logic.
JSP/Swing is the view that the users see. The user is least concerned with what is going on in the background. Even at the design time, the designers should not be bother about the business logic that has to be implemented. So this pattern was developed, where Bean is the model. So you can use JSP or any other view & call the methods from the bean & show the results. So its not exactly JSP/Beans, it can be Swing/Beans too & the Bean that is implemented with JSP could be the same with Swing too.
Hope you get the point.

Malhar Barai
SOA & Java Book
I agree. Here's the link:
subject: java bean..
It's not a secret anymore!