JavaServer Pages, 2nd 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 August 11, 2005. 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: p. [M], Library of Congress Cataloging-in-Publication Data "JavaServer pages / Hans Bergen.--2nd ed." should be "JavaServer Pages / Hans Bergsten.--2nd ed." p. xxii, the signature at the very end of the page "Hans Bersten" should be "Hans Bergsten" (33) 6th paragraph; When referring to the environment variables to set (JAVA_HOME and PATH), JAVA_HOME is split across two lines. For the sake of clarity, this token should not be split. [38] Third paragraph under "installing the book examples" heading; The stated location of the book examples on the author's website is incorrect. He notes that they can be located at: http://www.thejspbook.com/examples/jspbook.zip and they're actually at: http://www.thejspbook.com/jspbook.zip This used to be the case but I've added a link so both URLs work now From : (55) Source code; The name of instance variable fileNames, which has been written as plural, should be replaced by fileName in the following places: [...] The code is correct; I use plural because it's a list of filenames, and the code compiles and runs as-is. (65) The code listed in "Brief Custom Action Introduction for Java Programmers" contains the following function: public int doEndTag( ) { mmb.setCategory(category); JspWriter out = pageContext.getOut( ). try { out.println(mmb.getMessage( )); } catch (IOException e) {} return EVAL_PAGE; } The second statement ends with a period rather than a semicolon. Should be: public int doEndTag( ) { mmb.setCategory(category); JspWriter out = pageContext.getOut( ); try { out.println(mmb.getMessage( )); } catch (IOException e) {} return EVAL_PAGE; } (82) last paragraph; the closing tag should be , not (92) 3rd paragraph; The paragraph starting with "The Gender field isn't represented ..." is disconnected from following paragraph which continues the sentence started. {98} 3rd paragraph; The sentence "For instance, February 28 is a valid date only for a leap year". In our calendar, there is a February 28 every year. I suppose the author meant the February 29. Ooops, yes that's my mistake. (117) 2nd paragraph Also note that the error page URI in Example 9-11 includes a query string with the debug parameter, and that a action sets a request scope variable: It should say Also note that the error page URI in Example 9-11 includes a query string with the debug parameter, and that a action sets a request scope variable: (120) IN PRINT: last paragraph, second sentence; "...the action..." SHOULD BE: "...the action..." (120) IN PRINT: last paragraph, last sentence; "The blocks tests..." SHOULD BE: "The block tests..." {138} the code sample directly above table 10.4 The tag is missing the ending " /". It should be: (161) Table 11-3; For the "dataSource" attribute, the corresponding Java type "javax.sql.DataSource" has the last "e" character formatted as the "or" that follows it, while it should have the same formatting as "javax.sql.DataSourc" that it belongs to. (in other words, the "e" shouldn't be bold) (190) pargraph 2, sentence 1; The phrase "know as the realm" should be "known as the realm" {301} IN PRINT: First paragraph, second sentence; "...attribute is not the current page,..." SHOULD BE: "...attribute is the current page,..." {478} The fourth line of example 23-1; class ConnectionWrapper implements Connection { should be: public class ConnectionWrapper implements Connection { {485} code listing continued from previous page (line in bold); also in next code listing after that; References to Config.SQL_DATASOURCE should be Config.SQL_DATA_SOURCE {495} first try{} block in doEndTag() method; "List values = new List();" should be "List values = new ArrayList();" In addition, the "import java.util.List" statement at the top of the same page should be changed to "import j\ ava.util.*" {504} IN PRINT: "Scripting Elements" section, "Syntax 2" subsection; declaration SHOULD BE: declaration {505} IN PRINT: "Expression" section, "Syntax 2" subsection; expression SHOULD BE: expression (510) in the Syntax section for jsp:plugin; The "codeBase" attribute should be "codebase" for jsp:plugin. {520} last Example Is: SHOULD BE: {543} IN PRINT: Syntax 2 and Syntax 3; SHOULD BE: {505} IN PRINT: "Scriptlet" section, "Syntax 2" subsection; scripting code fragment SHOULD BE: scripting code fragment {635} Index entres for Delimiters (under Symbols heading); There are several errors with the entries for the various delimiters: 1. The directive delimiter <%@ only has page 48 listed, but it is also discussed in detail on page 28. 2. The entry for <%= is identified as a comment delimiter when it is in fact an Expression Delimiter. 3. The comment delimiter <%-- is missing from the Symbols entry. So this: <%@ ... %>, directive delimiter, 48 <%= ... %>, comment delimiter, 29 should be: <%@ ... %>, directive delimiter, 28, 48 <%= ... %>, expression delimiter, 29 <%-- ... --%>, comment delimiter, 48