currently I'm working the "Head First Servlets and JSP" over, and this book is really great stuff!
But after reading the chapters 9 "Custom tags are powerful" and 10 "When even JSTL is not enough..." I'm a little confused about what can be in a tag body.
In chapter 9 they say the <body-content> element can be JSP by what "the tag body can have anything that can go inside a JSP".
In chapter 10 they say "The crucial thing you must remember about JspFragment is that it must NOT contain any scripting elements!".
But the body of a tag that invokes a simple tag handler is encapsulated in the JspFragment object and sent to the tag handler in the setJspBody() method.
This strikes me as inconsistent. What's the crucial point?
The API says: "The definition of the JSP fragment must only contain template text and JSP action elements. In other words, it must not contain scriptlets or scriptlet expressions."
It is assumed that <body-content>JSP</body-content> is allowed in the TLD if you don't forget that the tag body must not contain scriptlets or expressions.
Originally posted by Michael Moeller:
I assumed that the .jspf extension is used as a programming practice to differentiate source files of complete JSP pages (.jsp) and source files of JSP segments (.jspf) that need not be legal JSP pages since they are statically included.
This is correct.