Java Servlet Programming

Errata for Java Servlet Programming

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 i
server_root/webapps/ROOT/WEB-INF/package.name</i> ..."

should read: "if the servlet were part of a package, it would need to be placed in

Anonymous   
Printed
Page i
server_root/webapps/ROOT/WEB-INF/classes/package.name</i> ..."

i.e. the string <i>classes</i> should be between <i>WEB-INF</i> and

Anonymous   
Printed
Page i
package.name</i>

Anonymous   
Printed
Page page 333
the getDateUsingSocketObject method lists...

Socket socket = null; try { // Establish a socket connection with the servlet Socket socket = new Socket(getCodeBase().getHost(), getSocketPort()); It should be: Socket socket = null; try { // Establish a socket connection with the servlet socket = new Socket(getCodeBase().getHost(), getSocketPort());

Anonymous   
Printed
Page 5
6th line from bottom

http://www.microsoft.com/workshop/server/default.asp should be: http://www.microsoft.com/asp/

Anonymous   
Printed
Page 9
1st paragraph

"Most Java-based application support servlets..." should read "Most Java-based application servers support servlets..."

Anonymous   
Printed
Page 19
2nd paragraph, 6th line

"an HttpSession class" should be replaced by "an HttpSession interface".

Anonymous   
Printed
Page 22
2nd full paragraph

The text: "if the servlet were part of a package, it would need to be placed in

Anonymous   
Printed
Page 32
IN PRINT: Second paragraph, third bullet item, second sentence

"...ending with that prefix." SHOULD BE: "...ending with that suffix."

Anonymous   
Printed
Page 44
2nd paragraph from bottom

The reference to the web.xml deployment descriptor DTD points to the wrong appendix. It should be Appendix C, not F. Also title of Appendix is wrong.

Anonymous   
Printed
Page 62
Top of page in printFooter() method

The printFooter() method prints the ending BODY tag to out but does not print the ending HTML tag. The method should be: private void printFooter(PrintWriter out) throws ServletException { out.println("</BODY>"); out.println("</HTML>"); // this was omitted }

Anonymous   
Printed
Page 72
2nd paragraph.

The third sentence begins with "Compared this to....", it should be "Compared to ..." without the "this".

Anonymous   
Printed
Page 92

The code demonstrating getParameterValues() should use a parameter named "features" instead of "words". It has been changed to read: String[] features = req.getParameterValues("features");

Anonymous    Jun 01, 2001
Printed
Page 99
The ServletRequest should be HttpServletRequest. The same

change should be made to the sentence leading up to the example.

Anonymous   
Printed
Page 101
3rd paragraph)

The possible typo (between astrisks): "Example 4-16 shows ViewFile servlet that uses the getPathTranslated() and getMimeType() methods to return the file *is* given by the extra path information." The 2nd 'is' is confusing. Perhaps remove it and change the word given to described.

Anonymous   
Printed
Page 165
Example 6-1

The name of the WML file in the caption of Example 6-1 now reads "drinks.wml".

Anonymous    Jun 01, 2001
Printed
Page 179
Example 6-7

The method chart.addDataSet() has been removed from KavaChart and replaced by chart.addDataset(). Note the case of the "S". addDataSet() has been changed to: addDataset() in two locations.

Anonymous    Jun 01, 2001
Printed
Page 182
doGet() method Ex. 6-8

First try block closed too early; in the first "try" block, after "URL source = ServletUtils.getResource(....))" the try block is closed but the finally for the block ends at the end of the doGet method. The online examples and source do not have this error, just the printed example in the book. Correct Source code can be downloaded from Servlets.com

Anonymous   
Printed
Page 203
Example 7-1

The Example 7-1 code writing the HTML form has been changed to escape the double-quotes around item: NAME="item".

Anonymous    Jun 01, 2001
Printed
Page 207

The end of the first line of text refered to IDsgetPathInfo(). This has been changed to simply getPathInfo().

Anonymous    Jun 01, 2001
Printed
Page 241
Figure 8-2. A Friendly login form

Based on Example 8-5 and the surrounding context, the URL in the browser should be "http://localhost:8080/loginpage.html" instead of "http://localhost:8080/login.html".

Anonymous   
Printed
Page 287
Near bottom after comment starting with "If we get here..."

connections.put(con, Boolean.FALSE); should be - connections.put(con, Boolean.TRUE);

Anonymous   
Printed
Page 323
in the snippet of code 10.6

I believe the 'InputStream' object should be closed before exiting the 'getDateUsingHttpObject()' method: ... in.close(); <-- HERE // Return the string representation of the Date return date.toString(); }

Anonymous   
Printed
Page 374

"req.getNamedDispatcher" should be "context.getNamedDispatcher"

Anonymous   
Printed
Page 422
1st paragraph

The link shown for Tea, http://opensource.go.com no longer works. The new site for Tea is http://teatrove.sourceforge.net/

Anonymous   
Printed
Page 458
Example 15-4

The WebMacro.properties file shown in Example 15-4 has been truncated but the surrounding text didn't warn the reader to that effect. At the end of the listing, the following line has been added: # The file continues with "ADVANCED CONFIGURATION" features...

Anonymous    Jun 01, 2001
Printed
Page 483
Example 16-2: Lines 20 and 26 in the code (counting blank lines)

The code should add the TD and TH objects to the TR object, not to the table itself. So the code should be: Line 20: row.addElement(new TH().addElement(rsmd.getColumnName(i))); Line 26: row.addElement(new TD().addElement(rs.getString(i))); If you don't add the TH and TDs to the row then your HTML is not well formed since your <td> and <th>s are not inside the <tr> element.

Anonymous   
Printed
Page 489
Example 16-9

The code should add the TD and TH objects to the TR object, not to the table itself. So the code should be: Line 29 (from top of pg 489): row.addElement(new TH().addElement(rsmd.getColumnName(i))); Line 11 (from top of pg 490): row.addElement(td); If you don't add the TH and TDs to the row then your HTML is not well formed since your <td> and <th>s are not inside the <tr> element.

Anonymous   
Printed
Page 522
The paragraph under errorPage section

"The servlet may retrieve the Throwable as the context attribute as javax.servlet.jsp.jspException." Should be: "The servlet may retrieve the Throwable as the request attribute as javax.servlet.jsp.jspException."

Anonymous   
Printed
Page 531
1st code fragment

The code sample is: <%@ include file="pathFoFile" %> Should be: <%@ include file="pathToFile" %>

Anonymous   
Printed
Page 539
Last paragraph (point #4)

This step is would not be required if the ... In the above statement, the "is" looks like a typo. It should be removed.

Anonymous   
Printed
Page 641
2nd Paragraph, 2nd sentance

This sentance does not belong to this description and should be removed

Anonymous