• Post Reply Bookmark Topic Watch Topic
  • New Topic

jstl over scriplets  RSS feed

 
Ashish Kataria
Greenhorn
Posts: 14
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My questions are pretty straight forward..so i hope there's no confusion. There are separate questions for my separate confusions, so please answer accordingly.
1. why did we stop using scriplets?
JSPs were easier to code earlier(my personal opinion).
2. When did JSTL took over?
3. When should we prefer scriplets over JSTL?

thanks in advance..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashish Kataria wrote:My questions are pretty straight forward..so i hope there's no confusion. There are separate questions for my separate confusions, so please answer accordingly.
1. why did we stop using scriplets?

just you cant tell everything about your house/or you to your house painter! possibility of misunderstanding!
Ashish Kataria wrote:
JSPs were easier to code earlier(my personal opinion).
2. When did JSTL took over?

Actually Jstl is a friend of Jsp, but jsp(designer) is not much close to you, then you need a broker who can communicate between you and the designer?
Ashish Kataria wrote:
3. When should we prefer scriplets over JSTL?

*Not* Always! (see my answer of your first question)

Anything am i missing?
<edit>corrected the typo!</edit>
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scriptlets are an ugly solution. They place Java code in a View definition. Only a very sophisticated text editor can manage to jump between the 2 different types of syntax (HTML/java) without having nervous breakdowns. And debugging Java code off a web page is a major pain. It's a lot easier to put the code in a pure Java file and use JSP mechanisms to interface with that code.

JSTL is one attempt to make that less messy. Since JSTL is HTML/JSP/XML-style syntax, a text editor doesn't have to keep switching syntax modes. Also, the JSTL elements are pre-debugged and standardized, which makes them less expensive and troublesome to work with.

However, neither JSTL nor scriptlets are really suitable for major J2EE projects. For the industrial-grade webapps, we commonly use frameworks that can support the complexities of a major webapp. Java is an extremely expensive technology to develop for and to use, so if you just want a lightweight quick-and-dirty webapp, it's usually much faster and cheaper to use one of the less robust systems such as PHP, Python, Ruby, and so forth.

The commonly-used J2EE industrial frameworks include JSF, Struts, Cocoon, Wicket, and so forth. Most of these are built on the Model/View/Controller concept, which is the antithesis of putting executable Java code on web pages the way scriptlets do.
 
Ashish Kataria
Greenhorn
Posts: 14
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tim Holloway for sharing this with me. Definitely gave me a clearer picture.
 
Ashish Kataria
Greenhorn
Posts: 14
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Seetharaman Venkatasamy for your valuable time, but you might consider giving out some facts rather than putting it in humour(or wit). It might work in some cases, but this clearly did not resolve the issue. But thanks again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!