The errata list is a list of errors and their corrections that were found after the product was released.
The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.
| Version |
Location |
Description |
Submitted By |
| Printed |
Page 21
Illustration on the right side of the page |
I'm puzzled by the following sentence: "Using one server app per port, a server can have up to 65536 different server apps running (although it's possible to run more than one app on the same port if the apps use different protocols).
If so, could I deploy one app using FTP protocol and another one using HTTP, both on port 80? Is it a typo or did I make a mistake?
I think the last sentence should be:
(although it's possible to run more than one app on the same port if the apps use the same protocol).
|
Anonymous |
| Printed |
Page 81
Compiling the servlet |
On page 81 - Under the section Compiling the servlet the javac command line reads incorrectly:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java
It should be:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar -d classes src/com/example/web/BeerSelect.java
|
Anonymous |
| Printed |
Page 81
Compiling the servlet |
Correction to previous post:
On page 81 - Under the section Compiling the servlet the javac command line reads:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java
- this is correct if you are using UNIX!
However if you are using WINDOWS it should be:
javac -classpath \Users\bert\Applications2\tomcat\common\lib\servlet-api.jar;classes;. -d classes src\com\example\web\BeerSelect.java
|
Anonymous |
| PDF |
Page 82
Last paragraph - code snippet. |
In the "Build and test the model" paragraph you supplied a code snippet for a "sophisticated, rule-based expert system for the beer advice." Here it is:
package com.example.model;
import java.util.*;
public class BeerExpert {
public List getBrands(String color) {
List brands = new ArrayList();
if (color.equals(“amber”)) {
brands.add(“Jack Amber”);
brands.add(“Red Moose”);
}
else {
brands.add(“Jail Pale Ale”);
brands.add(“Gout Stout”);
}
return(brands);
}
}
In this code snippet, the model data is hardcoded and coupled with business logic. However, just a paragraph above on the page you said "Create the test class for the model (yes, before you build the model itself). You’re on your own here; we don’t have one in this tutorial." So I created a test class that has an enum (to match all defined colors with beers):
public enum Color {
Light{ArrayList<String> brands(){brandList.add("Heineken"); return brandList;}},
Amber{ArrayList<String> brands(){brandList.add("Corona");brandList.add("Budweiser"); return brandList;}},
Brown{ArrayList<String> brands(){brandList.add("Pabst"); return brandList;}},
Dark {ArrayList<String> brands(){brandList.add("Sapporo"); return brandList;}};
abstract ArrayList<String> brands();
private static ArrayList<String> getBrandFromColor(String color){
return Color.valueOf(color).brands();
}
};
With this code the model is encapsulated in an enum object. This forgoes the need for complex if/else statements, and makes the model definition clearer to understand. My point is that having hard-coded beer names and colors together with business logic is not the most robust way to define a model. I believe in true MVC the model data would be separate from the business logic (hence model-driven).
|
Igor Ganapolsky |
| Printed |
Page 84
code example |
The line "import java.util.*;" is not in bold even though it was not used in the previous servlet. this caused me two semantic errors when compiling because I did not add it at first.
|
Anonymous |
| Printed |
Page 85
Compiling the servlet |
On page 85 - Under the section Compiling the servlet the javac command line reads incorrectly:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java
It should be:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar -d classes src/com/example/web/BeerSelect.java
|
Anonymous |
| Printed |
Page 85
Compiling the servlet |
Correction to previous post:
On page 85 - Under the section Compiling the servlet the javac command line reads:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java
- this is correct if you are using UNIX!
However if you are using WINDOWS it should be:
javac -classpath \Users\bert\Applications2\tomcat\common\lib\servlet-api.jar;classes;. -d classes src\com\example\web\BeerSelect.java
|
Anonymous |
| Printed |
Page 90
Compiling the servlet |
On page 90 - Under the section Compiling the servlet the javac command line reads incorrectly:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java
It should be:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar -d classes src/com/example/web/BeerSelect.java
|
Anonymous |
| Printed |
Page 90
Compiling the servlet |
Correction to previous post:
On page 90 - Under the section Compiling the servlet the javac command line reads:
javac -classpath /Users/bert/Applications2/tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java
- this is correct if you are using UNIX!
However if you are using WINDOWS it should be:
javac -classpath \Users\bert\Applications2\tomcat\common\lib\servlet-api.jar;classes;. -d classes src\com\example\web\BeerSelect.java
|
Anonymous |
| Printed |
Page 179
11 |
When does step 11 happen? When the web app starts, or when the app gets a request at ListenTest.do?
I read the story twice before I noticed the ListenerClass.class in the diagram, I thought initially that step 11 followed step 10 without user interaction.
Currently it says:
Container makes a new Servlet (ie, ...).
I suggest, (if this correct):
"User submits a request to http://localhost:8080/listenerTest/ListenTest.do and the container makes a new servlet of class ListenerTester (ie, ...)."
If this is wrong then I suggest:
"Container makes a new servlet of class ListenerTester (ie, ...)."
|
Anonymous |
| Printed |
Page 186
Grid 4th line 3rd column |
There's no such method getInitParameter(String name) for javax.servlet.ServletRequest,
javax.servlet.HttpServletRequestWrapper, javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletRequestWrapper.
The correct is method getInitParameter(String name) for Application/ServletContext,Servlet,GenericServlet,HttpServlet and
getParameter(String name) for all classes/interfaces down the ServletRequest interface hierarchy (that is, extends or implements ServletRequest interface).
Since your differing Attributes and Parameters, I suggest indeed a third category: not Attributes, not Initialization Parameters, but Parameters (even better: "Arguments") related to the underlying protocol's request...
|
Anonymous |
| Printed |
Page 215
Question 1 |
When I call the getOutputStream method on the response object and use the RequestDispatcher to perform a forward I get and IllegalStateException even if I do not write to or flush the output stream. For this reason I think choice D is also correct.
|
Anonymous |
| Printed |
Page 336
Answer to question #6 |
The answer should be D (not E).
|
Anonymous |
| Printed |
Page 344
last line of first paragraph under 7.1 |
implicit variable is cookie not cookies.
|
thuy nguyen |
| Printed |
Page 396
last bullet point |
The uri attribute in the sample JSP directive has the location of the TLD file, but according to page 389, it should match the value of the <uri> tag in the Tag Library Descriptor file.
|
Anonymous |
| Printed |
Page 414
second to the last bullet |
This bullet is incorrect and should be deleted.
|
Anonymous |
| Printed |
Page 428
Question # 7 Option# C |
Question#7 Option#C is marked correct. When "foo" is a map doesn't the argument ["5"] has to match java naming rules.
|
Anonymous |
| Printed |
Page 429
Question 9 |
the querystring has just the firstname and the last name as:
"?firstname=John&lastname=Doe"
it does not contain anything regarding ${param:middlename}, then too the correct ans marked is option no B that says output produced would be "John Doe Doe".
My query is why Doe twice ??? Shouldn't it be only "John Doe" better (as null is a valune in Java) "John null Doe".
|
Anonymous |
| Printed |
Page 434
Section 9.3 |
The tag mentioned is url but actualy the tag is import (with url as attribute)
|
Anonymous |
| Printed |
Page 437
question 17 |
Page numbers in the errata list don't match those of the printed book.
The error in the answer for the question 17 on the page 437 in the book is already reported in the errata list, but it is said to be found on the page 432!
The page number references in the errata list are wrong in general and don't match those of the book (at least not those of the book that I have, the second edition from 2008).
Mistakes happen, sure, but please at least try and make the corrections right.
|
Anonymous |
| Printed |
Page 562
Question 7 Answer B |
This (Mock Exam question) is the first time that the <dynamic-attributes> tag is mentioned. I propose a one or two-liner somewhere in the Simple Tag section of the chapter at least stating that <dynamic-attributes> is a valid TLD tag and that it is necessary for use of Dynamic Attributes in the Simple Tag Handler.
Otherwise, please remove this question from the Chapter 10 Mock Exam, as the reader would have no way of answering it correctly, using the book alone.
|
Anonymous |
| Printed |
Page 567
Question 18, Option F |
Option F for Q. 18 says that "For every attribute declared and specified in a Tag File, the container creates a page-scoped attribute with the same name."
But on Page 494, the 'Bang' alert box says "All tag attributes have tag scope"
The two statements seem to contradict each other.
|
Anonymous |
| Printed |
Page 757
Question 9 |
Shouldn't answer include A as well?
Transfer Object is
-related to Business Delegate
-improves Network performance
-can improve client performance through caching.
|
Anonymous |
| Printed |
Page 795
Question #65 |
It says that the answer is A & D.
A is an incorrect answer since CLIENT-CERT does not require a password. It uses a Public Key Certificate for authentication.
|
Anonymous |
| Printed |
Page 832
Question 63 |
The answer given is D (Only line 5 will generate an error).
The answer should be G (The entire JSP could execute without generating any errors).
It's because since the tag c:out isn't recognized anyway, this will be parsed as normal HTML. The output of <c:out value="hello"/> will not be shown on the page, but when you view the source, you will see the line
<c:out value="hello"/>
|
Anonymous |