This topic didn’t fit well anywhere else, so we decided to stick it in this chapter since we’re talking about XML so much. The exam doesn’t require you to be an XML expert, but you do have to know two things: the syntax for the key DD elements, and the basics of making what’s known as a JSP Document. (“As opposed to what? If a normal JSP isn’t a document, what is it?” That’s what you’re asking, right? Think of it this way—a normal JSP is a page, unless it’s written with the XML alternatives to normal JSP syntax, in which case it becomes a document.)
All it means is that there are really two types of syntax you can use to make a JSP. The text in grey is the same across both types of syntax.
Normal JSP page syntax
JSP document syntax
Directives (except taglib)
<jsp:declaration> int y = 3; </jsp:declaration>
<jsp:scriptlet> list.add("Fred"); </jsp:scriptlet>
<jsp:text> There is no spoon. </jsp:text>
<jsp:expression> it.next() </jsp:expression>
This is all the exam covers on JSP Documents.
We aren’t going to say any more about it because writing XML-compliant JSP documents is probably not something you’ll do. The XML syntax is used mainly by tools, and the table above just shows you how the tool would transform your normal JSP syntax into an XML document. ...