This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
The moose likes JSP and the fly likes Disadvantages of scriptlets in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Disadvantages of scriptlets in JSP" Watch "Disadvantages of scriptlets in JSP" New topic

Disadvantages of scriptlets in JSP

Sai Surya
Ranch Hand

Joined: Feb 08, 2006
Posts: 462

Dear All,

I am aware that JSP will be translated into Java. I read somewhere that using scriptlets in JSP will have performance impact. I do not understand how this can impact performance?

Since JSP will be converted to .java file anyway, if we use scriplets in JSP we are infact "saving" the compilation time (JSP to .java). This should rather be a performance improvement.

If we purely use tags (for example, JSTL) the conversion to .java is still required.

Please help me to understand this.

Sai Surya, SCJP 5.0, SCWCD 5.0, IBM 833 834, I believe in Murphy's law.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Performance has nothing to do with the decision not to use scriptlets.

We avoid using them because they're ugly.
For a real good and detailed explanation of this ugliness read
this article by Bear Bibeault.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Sai Surya
Ranch Hand

Joined: Feb 08, 2006
Posts: 462

Thank you. It really helped.
Have you tried LearnNowOnline?
subject: Disadvantages of scriptlets in JSP