• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Disadvantages of servlet?

 
Ranch Hand
Posts: 630
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read in SL-314 given by sunmicrosystem book

Disadvantage of Servlet
Servlet often contain both business logic & presentation logic.


Explanation: Mixing presentation & business logic means that whenever a web page changes(Which can be monthly or weakly for many applications) the servlets must be rewritten, recompiled, & redeployed.

In JSP also writen same disadvantage.

Disadvantage of JSP
JSP often contain both business logic & presentation logic.


Both Servlet & JSP follows MVC(Model View Controller) pattern using Model 2 architecture ie servlet act the controller, JSP act as the view & java technology classes act as the model.
Why these are disadvantages? What is benefit of separating business logic & presentation logic or Model, view & controller.

& in J2EE platform facilitates an architecture in which the business component are place in separate tier.
my question is in Servlet & JSP why we can not create 3 tier application like J2EE architecture example, Internet client using web browser sends Http Request to web server. In web server, there is web container contains controller. there is another server that is EJB server which contain model. & database is separate. ie i think this is 3tier application.
If using EJB we get security then why people use sevlet & JSP?
Thanks in advance & sorry for asking question wrong way of English.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Both Servlet & JSP follows MVC(Model View Controller) pattern using Model 2 architecture ie servlet act the controller, JSP act as the view & java technology classes act as the model.Why these are disadvantages?



Whether servlets and JSP follow the MVC model 2 architecture or not is implementation dependent.I mean as stated above when you mix the business logic with the presentation either in a servlet or a JSP, you are not following the MVC-2.


What is benefit of separating business logic & presentation logic or Model, view & controller.


Obvious better control and maintainable application.

in Servlet & JSP why we can not create 3 tier application


we can create not only three tier but n tier application.


If using EJB we get security then why people use sevlet & JSP?


We do get security using servlet and JSP and also EJB in itself is a heavy weight entity and no one will prefer it for small sized applications.


Hope this helps .
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read in SL-314 given by sunmicrosystem book

quote isadvantage of Servlet
Servlet often contain both business logic & presentation logic.

In JSP also writen same disadvantage.

quote isadvantage of JSP
JSP often contain both business logic & presentation logic.


Hi Amit,

J2EE application with only jsp and servlets are not pure MVC.
Web container's controller is only mapping request to servlet and giving you respopnse. but when we talk about sepration between Model View and Controller then controler must able to do
1.indepandancy in Model and view it means suppose your servlet name change you need not to go in view means action of html form and change servlet name.& same in vice versa.
2.Request Dispatch it means controller must able to do flexsible dispatch of request & mapping of view.
for ex. if you have J2EE apllication of NetBanking and you want to change it for MobileBanking then same view part does not works.u have to chage it for GUI then your application should allow it without changing Model.
3.Exception,Error Handeling: Controller should be flexible for this.

when such things are there we can say its pure MVC Arcitecture.

These disdvantages is removed in struts framwork.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Santosh Kolekar

J2EE application with only jsp and servlets are not pure MVC.


Why not? its implementation dependent.

These disdvantages is removed in struts framwork.


It is a fact that struts itself uses servlets.
And moreover its a framework.


Hope this helps
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

If using EJB we get security then why people use sevlet & JSP?


The reason people use servlets/JSPs is not to provide security -although they can do that to a certain degree- but in order to provide web access capability. How would a web browser access an EJB if not through a web app based on servlets and JSPs?
 
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic