20.9 Summary

In principle, everything that can be accomplished with JSP can be accomplished with servlets alone. In practice, JSP makes the generation of HTML content easier and more reliable. In doing so, JSP encourages a separation between the Java code that generates the content and the HTML code that presents it, thus permitting the use of standard HTML development tools, a division of labor on large projects, and the ability to change either the content or the presentation without altering the other piece.

As a result, few real sites use servlets alone. That does not, however, mean that they use JSP entirely in lieu of servlets. Instead, complex sites typically combine servlets and JSP, using servlets for some pages, JSP for others, and ...

Get Core Web Programming, Second 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.