• Post Reply Bookmark Topic Watch Topic
  • New Topic

Weaknesses of JSP

 
Nilesh Sanyal
Ranch Hand
Posts: 33
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am studying JSP after studying servlets. I found many weaknesses of servlets. But I can not figure out weaknesses of JSP. If any weakness exists, please write about it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1 weakness: scriptlets were not deprecated and removed from JSP 2 in 2002 when the JSTL and EL were introduced, resulting in people continuing to put Java code into JSPs.

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By appearing to be easier to master than servlets, JSP tempts people into doing dumb stuff.

(historical note) As I recall, the only reason for the existance of JSP was that Microsoft was pushing ASP active server pages so Sun had to come up with a parallel. Early Java had lots of "features" that turned out to be a bad idea - just like many other computer tools.(/historical note)

Bill
 
Amelia Martin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nilesh Sanyal wrote:I am studying JSP after studying servlets. I found many weaknesses of servlets. But I can not figure out weaknesses of JSP. If any weakness exists, please write about it.


In Java Server Page we can’t separate business logic and presentation logic. For this reason Model View Controller concept is incorporated in java.
 
Tim Holloway
Bartender
Posts: 18414
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:
(historical note) As I recall, the only reason for the existance of JSP was that Microsoft was pushing ASP active server pages so Sun had to come up with a parallel.


I don't think so.

I first started working with Enterprise Java before JSPs were invented. All we had was servlets which we had to carve out of stone with our bare hands while walking uphill in the snow. Or at least all we had were servlets.

Servlets are good when the bulk of the work is logic. However, they were a distinct pain when large parts of the output are display directives (HTML, javascript and the not-yet-invented CSS). Most of the servlet code code was "print statements". So when the precursors to JSP and then JSP came out, I was very happy.

I also quickly saw the drawbacks when scriptlets got involved. At the time, editing a JSP would cause severe hiccups and even possible IDE failures, because a JSP with embedded code was constantly switching editor language modes, from HTML/JSP to Java as you moved the cursor up and down the file. And debugging code in JSPs was/still is a nightmare.

Fortunately, it wasn't very long before MVC-style frameworks such as Struts were developed that allowed breaking the model, code, and view into discrete components. Which, admittedly raised the number of source files that needed tracking, but made things a lot easier to work with on an enterprise scale.

Sun tried to ape Microsoft, but they neved did get their tools polished or widely adopted. WYSIWYG editors for JSPs and DDD (drag, drop, drool) editors for JavaBeans never did become "prime time" quality.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!