As evidenced in Chapter 32, there are two drawbacks servlets are not capable of overcoming. First, when sending a response, all HTML tags must be enclosed in strings, making sending HTTP response a tedious effort. Second, all text and HTML tags are hardcoded, and, as a result, minor changes to an application presentation part, such as changing a page background color, requires recompilation.
JavaServer Pages (JSP) comes to the rescue and solves the two problems in servlets. JSP does not replace Servlet, however, but complements it. Modern Java Web applications use servlets and JSP pages at the same time. The latest version of JSP at the time of writing is 2.3.
A JSP Overview
A JSP page is essentially a servlet. However, ...