The previous sections got us started with Tomcat, servlets, and Eclipse WTP. As you saw, despite the benefits provided by Eclipse WTP (it generated all the structure of the web project for us and also took care of generating a significant chunk of code when we implemented the previous example servlet), embedding HTML into your Java code feels a little awkward. As we mentioned, JSPs were introduced to make the creation of dynamic content more straightforward and appealing. JSPs let you mix HTML and Java code in a better way than servlets. Rather than embedding HTML into Java code, JSP makes it possible to embed dynamic content into HTML. Recall from the previous sections that a JSP is an HTML page containing some special elements. The elements that are rendered into dynamic content resemble HTML elements. However, they are componentized Java programs. Besides these HTML-like elements, a JSP page can also include Java code (scriptlets).
It...