Professional Documents
Culture Documents
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.
Confirmed errors:
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
web-app_2_4.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
[62]
The 4th hand-written note "Gets the response from the container"
should read "Container generates the HTTP response stream from
the data in the response object" in the column marked "Container"
However, that line never appeared in the servlet version two code and should be added
(uncommented out and in bold) just above the following line on page 84:
BeerExpert be = new BeerExpert();
AUTHOR:
This is how I would reorganize these two code examples in a
future printing of the book.
(90) first sentence following "Deploying and testing the web app";
"redploy"
should be:
"redeploy"
should be:
"The HTTP 1.1 spec declares GET, HEAD, and PUT as idempotent, even
though you CAN write a non-idempotent doGet() method
Suggesting rewording: "A: Developers who want to support both methods usually put
logic in doGet(), and then have the doPost() implementation delegate to that doGet():"
Fourth hand-written note from the top should read: See... the
"myApp/cool" part of the path isn't here this time.
Without the import the code won't compile because the Enumeration class is used.
<servlet-name>
BeerParamTests
</servlet-name>
[213] Q 12 - item D;
ServletRequest
should be:
HttpServletRequest
should be read:
out.println("<a href=\"" +
response.encodeURL("/BeerTest.do") +
"\">Click Me</a>");
{245} Example 2;
delete the line:
String foo = (String) session.getAttribute("foo");
if (cookies!=null) {
}
after
Cookie[] cookies = request.getCookies();
[254] Standout titled "You do NOT configure session binding listeners in the DD!;
Standout reads:
"You do NOT configure session binding listeners in the DD! ... But this is NOT true
for the other session related listeners on the previous page. HttpSessionListener,
HttpSessionAttributeListener, and HttpSessionActivationListener must be registered
in the DD, since they're related to the session itself, rather than an individual
attribute placed in the session."
Should read:
Should read:
'Any object bound into a session is available to any other servlet that belongs to
the same ServletContext and handles a request identified as being a part of the same
session.'
Answer C leaves off the final part of the sentence: 'and handles a request identified
as being a part of the same session.' Without this answer C is not correct.
SHOULD BE:
<%= becauseThisIsAnArgumentToPrint() %>
is misleading, the snippets should have continued to use the same pseudo-code as the
snippet on page 291,
... extends SomeSpecialHttpServlet {
JSP specification page 78 table JSP.1-7 Implicit Objects Available in Error Pages
(297) Heading;
This should be labelled a "Be the Container" exercise.
<servlet>
<servlet-name>MyTestInit</servlet-name>
<jsp-file>/TestInit.jsp</jsp-file>
<init-param>
<param-name>email</param-name>
<param-value>wecare@wickedlysmart.com</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>MyTestInit</servlet-name>
<url-pattern>/TestInit.jsp</url-pattern>
</servlet-mapping>
(325) Exercise 2;
change the "ignored" column title to "error".
should be
should be
The first variable is either..., and the thing to the right of the dot is either a
map key(if the first variable is a map) ...
It should read "To help you remember, the include directive <%@ include
file="foo.jsp"%> is used only at translation time (as with all directives)."
(549) question 1;
first "to" is a typo
[550] question 3;
Option C is invalid.
Unfortunately, that leaves us with a mock question that doesn't have a valid answer.
the DD-XML:
<security-role>
<role-name>Admin</role-name>
<role-name>Member</role-name>
<role-name>Guest</role-name>
</security-role>
should read:
<security-role>
<role-name>Admin</role-name>
</security-role>
<security-role>
<role-name>Member</role-name>
</security-role>
<security-role>
<role-name>Guest</role-name>
</security-role>
{643}
The deployment descriptor on the right hand side of the page has two errors.
First the closing and opening <web-app> tags should be dropped; this is all a single DD.
Second, there should be only one <role-name> subelement in the <security-role>
element.
Remove the Member and Guest roles as they are not needed in this example.
(679) LL;
<filter-mapping> element declared at the top of the code ends with </filter>
it should end with
</filter-mapping>
(697) bottom;
The answer to question 3 on p. 701 is given as "E. None of the above".
However, for question 3 on p. 697, there is no choice E.
(703) question 5;
option D should be checked.
(785 and 823): There is a typo in the open tag in Option B. It should read <auth-
constraint>.