A JSP becomes a servlet. A servlet that you don’t create. The Container looks at your JSP, translates it into Java source code, and compiles it into a full-fledged Java servlet class. But you’ve got to know what happens when the code you write in the JSP is turned into Java code. You can write Java code in your JSP, but should you? And if you don’t write Java code, then what do you write? How does it translate into Java code? In this chapter, we’ll look at six different kinds of JSP elements—each with its own purpose and, yes, unique syntax. You’ll learn how, why, and what to write in your JSP. Perhaps more importantly, you’ll learn what not to write in your JSP.
The JSP Technology Model
Identify, describe, or write JSP code for the following elements: (a) template text, (b) scripting elements (comments, directives, declarations, scriptlets, and expressions), (c) standard and custom actions, and (d) expression language elements.
Write JSP code that uses the directives: (a) page (with attributes import, session, contentType, and isELIgnored), (b) include, and (c) taglib.
Write a JSP Document (XML-based document) that uses the correct syntax.
Describe the purpose and event sequence of the JSP page lifecycle: (1) JSP page translation, (2) JSP page compilation, (3) load class, (4) create instance, (5) call the jspInit method, (6) call ...