Errata

JavaServer Pages

Errata for JavaServer Pages

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page xiii
2nd bullet

JST should be JSTL

Anonymous   
Printed
Page 19
paragraph on Efficiency; third line:

that
should be
than

Anonymous   
Printed
Page 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("

Anonymous   
Printed
Page 28
first paragraph

"...let's call this a forth element type..."
should be:
"...let's call this a fourth element type..."

Anonymous   
Printed
Page 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 "<c:out...." is not marked.

"1 + 2 + 3 = " at the beginning of the line should be highlighted.

Anonymous   
Printed
Page 57
last paragraph

By now should you
should be:
By now you should

Anonymous   
Printed
Page 63
paragraph after Example 6-2

...fileName property value from the carton bean...
should be
...fileName property value from the cartoon bean...

Anonymous   
Printed
Page 75
Figure 7-2

Text in figure reads: "If you're robbing a bank and you're pants fall down, ..."
Text should read: "If you're robbing a bank and your pants fall down, ..."

Anonymous   
Printed
Page 81
bottom half

Line:
<input type="text" name="luckynumber">

should be in bold print

Anonymous   
Printed
Page 101
second paragraph

"one piece at the time" should read "one piece at a time"

Anonymous   
Printed
Page 105
last code snippet

The ending '}' is missing from the expression:
<my:myAction attr="${myFunction(someArg, anotherArg)" />
it should be:
<my:myAction attr="${myFunction(someArg, anotherArg)}" />

Anonymous   
Printed
Page 109
2nd paragraph

The error:
/ch9/error2.jsp(14,0) Unterminated <c:out tag

has a follow up paragraph that seems to describe a different error, since the
locations don't seem to match up. The books says "the position information points to
the first character after the syntax error"

AUTHOR: Line 14 position 0 in the error2.jsp file is the first character of the
last line, not the first line after the error.

Anonymous   
Printed
Page 110
third paragraph following example 9-4

"they where not processed" should read "they were not processed"

Anonymous   
Printed
Page 123
Section immediately following table 9-2

The reference to Example 9-11 should be to Example 9-12 (the error page)

Anonymous   
Printed
Page 127
second line after Figure 10-1

The text refers to userinputvalidate.jsp, but the figure calls that file userinfovalidate.jsp.

Anonymous   
Printed
Page 127
4 line from bottom

... represents the Model, the userinputvalidate.jsp page the Controller...
should be:
... represents the Model, the userinfovalidate.jsp page the Controller...

Anonymous   
Printed
Page 133
1st paragraph last sentence

View page depending of the result
^^
should be:

View page depending on the result

Anonymous   
Printed
Page 146
last paragraph

but that the link URL is left unencoded
^^^^
should be:

but the link URL is left unencoded

There is another typo in the next sentence.

Leaving the URL variable untouched is important, because otherwise,
^^^^^^^
should be:

Leaving the URL variable untouched is important, otherwise,

Anonymous   
Printed
Page 146
Last paragraph

Says "the link URL is left unencoded." Okay, in the concrete example
this is not an issue, because there is only one parameter. But HTML-Tidy
complains about & in links like <a href="example.jsp?a=b&x=y">. It should
be <a href="example.jsp?a=b&amp;x=y"> (see http://www.w3.org/TR/html4/appendix/
notes.html#h-B.2.2). Therefore, in general, I suggest <a href="<c:out
value="${productURL}"/>">.

AUTHOR'S REPLY:

Oops, yes you're right; the URL _should_ use &amp; instead of &.
So, use either <c:out> (as you suggest) or ${fn:escapeXml()} (which
I think is cleaner, especially for code that is used as an HTML attribute).

Anonymous   
Printed
Page 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

Anonymous   
Printed
Page 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".

Anonymous   
Printed
Page 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.

Anonymous   
Printed
Page 215
Paragraph following Figure 13-1

autheticate.jsp should be changed to authenticate.jsp

Anonymous   
Printed
Page 253
Table 14-10

The attribute name "pattern" in the <fmt:formatNumber> table (page 253 table 14-10)
seems to have the wrong description.
It looks like the description was copied from the <fmt:formatDate> 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).

Anonymous   
Printed
Page 273
last line of page

"The xsl attribute is set ..."
should read:
"The xslt attribute is set ..."

Anonymous   
Printed
Page 275
Second code snippet

<x:param name="empName" value="${param:empName}" />
^
should be:

<x:param name="empName" value="${param.empName}" />

Anonymous   
Printed
Page 322
jsp-property-group examples

On page 322 at the top of page, the </jsp-property-grop> end element
^^^^
should be:

</jsp-property-group>

The "u" in group is missing. This occurs again on page 323 (twice), page 324
(twice), page 325 (once) and page 326 (twice).

Anonymous   
Printed
Page 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).

Anonymous   
Printed
Page 367
first method

init() throws ServletExecption
should be:
init() throws ServletException

Anonymous   
Printed
Page 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 <body-content> must be set to scriptless for this tag to work as described on 429.

Anonymous   
Printed
Page 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.

Anonymous   
Printed
Page 447-448
Example 21-9

items should be a Collection, not a String

Anonymous   
Printed
Page 477
Listing of VariableProducerTag

public void setScope (String scope)
should be
public void setScope (String scopeName)

Anonymous   
Printed
Page 482
example 22-4

The code line:

_jspx_th_xmp_varProducer_1.setId("myVariable");
^^^^^^^^^^
should be:
_jspx_th_xmp_varProducer_1.setId("someList");

Anonymous   
Printed
Page 532
sample code

<res-sharing-scope>Sharable</res-sharing-scope>
Should be:
<res-sharing-scope>Shareable</res-sharing-scope>

Anonymous   
Printed
Page 533
several places

You may want to change 'sharable' and 'unsharable' to 'shareable' and 'unshareable'
respectively to be consistent with '<res-sharing-scope>Shareable</res-sharing-scope>'
throughout the book.

Anonymous   
Printed
Page 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 = ?";

Anonymous   
Printed
Page 541
Example 24.-8

The sql:query element in example 24-8 seems to have have some extra attribute information

<sql:query var="newEmpDbInfo"="${example}" scope="session">
^^^^^^^^^^^^^
should be:
<sql:query var="newEmpDbInfo" scope="session">

Anonymous   
Printed
Page 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); %>

Anonymous   
Printed
Page 575
<c:if> Syntax description

There are two "Syntax 1" items. The second should be "Syntax 2"

Anonymous   
Printed
Page 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.

Anonymous   
Printed
Page 702
Example F-1 (web.xml partial listing)

The line that reads:

version="2.4>

should be:

version="2.4">

Anonymous