It's not a secret anymore!
The moose likes Servlets and the fly likes JSP and Java Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP and Java Beans" Watch "JSP and Java Beans" New topic

JSP and Java Beans

Danish Shaukat
Ranch Hand

Joined: Nov 16, 1999
Posts: 340
I've done some extensive work with servlets. Now i'm doing jsp.
The jsp model 2 architecture specifies that use
jsp for presentation
servlet as the controller
java bean for business logic.
My question is what if i put all business logic in servlet and do not use java beans??
Can we do away with java beans?
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
Of course it depends on what you want to do.
The important thing is (and I think you got it) the clear separation of presentation (JSP) and logic or as I call them, calculations needed by the Web Application.
Your bean vs. servlet question is hard to answer if we don't know the complexity of the "calculations".
Of course a Servlet can do it. The question is "Reusability". If you need it, then beans are the answer. IF not, maybe the servlet can do a one-time processing of data.
My experience says that reUsability is more important

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
I agree. Here's the link:
subject: JSP and Java Beans
It's not a secret anymore!