JavaServer Pages, 3rd Edition by Hans Bergsten This errata page lists errors outstanding in the most recent printing. If you have technical questions or error reports, you can send them to booktech@oreilly.com. Please specify the printing date of your copy. This page was updated March 22, 2007. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: (xiii) 2nd bullet; JST should be JSTL (19) paragraph on Efficiency; third line: that should be than {23} Example 3-1, bottom of page; There is an extra "(" in the doGet() method in the first Java code example in the book. "public void doGet((" should be "public void doGet(" (28) first paragraph "...let's call this a forth element type..." should be: "...let's call this a fourth element type..." (51) Example 5-2, line with the JSP Action Element; In the example all Text should be highlighted that is "Template text" but the part infront of the " should be in bold print (101) second paragraph; "one piece at the time" should read "one piece at a time" {105} last code snippet; The ending '}' is missing from the expression: it should be: (109) 2nd paragraph; The error: /ch9/error2.jsp(14,0) Unterminated . It should be (see http://www.w3.org/TR/html4/appendix/ notes.html#h-B.2.2). Therefore, in general, I suggest ">. AUTHOR'S REPLY: Oops, yes you're right; the URL _should_ use & instead of &. So, use either (as you suggest) or ${fn:escapeXml()} (which I think is cleaner, especially for code that is used as an HTML attribute). {157} Last paragraph; The discussion of the special tag scope of a tag file neglects to mention that not only is the scope different from the page scope, but it is also exposed to the tag file as a different implicit variable. For tag files, the page scope is represented by the implicit variable jspContext and the pageContext implicit variable is not defined. See Table JSP.8-5 Implicit Objects Available in Tag Files in the JSP 2.0 specification. jspContext should also be mentioned in the Implicit Variables section of Appendix D JSP API Reference {170} The taglib directive at top of page 170; The taglib directive on page 170 has a URI attribute value of "mytags", it should be "mytaglib". {189} 1st paragraph (after example 12-2); The paragraph text is "At the top of the page is the same JSP directive for using the JSTL database tag library as in Example 12-1". Example 12-2 in fact does not have this directive included, nor does it need it since the result was stored in the session variable "newEmpDbInfo". This paragraph should likely be removed. (215) Paragraph following Figure 13-1; autheticate.jsp should be changed to authenticate.jsp {253} Table 14-10; The attribute name "pattern" in the table (page 253 table 14-10) seems to have the wrong description. It looks like the description was copied from the table (page 251 table 14-7) by mistake. The table on page 253 should be the same as the first table on page 586 (the fmt:formatNumber section of appendix B). (273) last line of page; "The xsl attribute is set ..." should read: "The xslt attribute is set ..." {275} Second code snippet; ^ should be: {322} jsp-property-group examples; On page 322 at the top of page, the end element ^^^^ should be: The "u" in group is missing. This occurs again on page 323 (twice), page 324 (twice), page 325 (once) and page 326 (twice). (358) Figure 18-2; The first "r" in Forward is missing on the arrow between the Controller and View circles. This occurs again on page 359 (Figure 18-3) and page 361 (Figure 18-4). (367) first method; init() throws ServletExecption should be: init() throws ServletException {430} Example 21-2; Line 27 getJspContext().setAttribute(var, currValue); should be pageContext.setAttribute(var, currValue); Otherwise, remove PageContext pageContext = (PageContext) getJspContext(); since it accomplishes nothing. Also, it is not clear that the must be set to scriptless for this tag to work as described on 429. {435} Figure 21-2; the screencapture is wrong. The cells for March 30 and 31 should have the same shading as the cells for May 1 - 3. {447-448} Example 21-9; items should be a Collection, not a String (477) Listing of VariableProducerTag; public void setScope (String scope) should be public void setScope (String scopeName) {482} example 22-4; The code line: _jspx_th_xmp_varProducer_1.setId("myVariable"); ^^^^^^^^^^ should be: _jspx_th_xmp_varProducer_1.setId("someList"); (533) several places; You may want to change 'sharable' and 'unsharable' to 'shareable' and 'unshareable' respectively to be consistent with 'Shareable' throughout the book. (532) sample code; Sharable Should be: Shareable {541} First code example; The code cited below that lives in the example at the top of page 541: String sql = "SELECT * FROM Employee WHERE UserName = ?"); ^ should be: String sql = "SELECT * FROM Employee WHERE UserName = ?"; {541} Example 24.-8; The sql:query element in example 24-8 seems to have have some extra attribute information ^^^^^^^^^^^^^ should be: {555} Last example on the page; at the end of the 4th line in the last code-block is the %> missing <% pageContext.setAttribute("scopedVar", headerPage); should be: <% pageContext.setAttribute("scopedVar", headerPage); %> (575) Syntax description; There are two "Syntax 1" items. The second should be "Syntax 2" {612} Examples for toLowerCase and toUpperCase functions; In the examples for functions toLowerCase and toUpperCase param:day should be param.day The same should be fixed for the startsWith() and trim() examples. {702} Example F-1 (web.xml partial listing); The line that reads: version="2.4> should be: version="2.4">