Scriptlets considered harmful?

Is it true? Could there be a downside to putting all this Java into your JSP? After all, isn’t that the whole frickin’ POINT to a JSP? So that you write your Java in what is essentially an HTML page as opposed to writing HTML in a Java class?

Some people believe (OK, technically a lot of people including the JSP and Servlet spec teams) that it’s bad practice to put all this Java into your JSP.

Why? Imagine you’ve been hired to build a big web site. Your team includes a small handful of back-end Java programmers, and a huge group of “web designers”—graphic artists and page creators who use Dreamweaver and Photoshop to build fabulous-looking web pages. These are not programmers (well, except for the ones who still think HTML is “coding”).

image with no caption

Aspiring actors working as web designers while waiting for their big showbiz break.

Get Head First Servlets and JSP, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.