File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 463

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: 463

Thank you. It really helped.
I agree. Here's the link:
subject: Disadvantages of scriptlets in JSP
It's not a secret anymore!