• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP and Java Beans

 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic