Corrections to Chapter 15 of Java Network Programming, The URLConnection Class

p. 476: In the first paragraph change "Example 15-5" to "Example 7-5"

p. 476: In the first line of the code fragment at the bottom of the page, a forward slash is missing between "HTTP" and "1.1". That is, change,

HTTP 1.1 200 OK

to

HTTP/1.1 200 OK

p. 485: In the second line of the first code fragment on the page, last-modification should be last-modified. That is, change

long lastModified = uc.getHeaderFieldDate("last-modification", 0);

to

long lastModified = uc.getHeaderFieldDate("last-modified", 0);

p. 489: in the first paragraph, the difference between opening a connection and actually connecting is garbled. At the top of the page, change "when the connection is closed" to "before the URLConnection is connected". Later in the first paragraph, change "when the connection is open" to "when the URLConnection is connected".

p. 492: In the first line of the second to last code fragment on of the page, a forward slash is missing between "HTTP" and "1.1". That is, change,

GET / HTTP 1.1

to

GET / HTTP/1.1

In the first line of the code fragment at the bottom of the page, a forward slash is missing between "HTTP" and "1.1". That is, change,

HTTP 1.0 304 Not Modified

to

HTTP/1.0 304 Not Modified

p. 498: In the first line of the second to last code fragment on the page, a forward slash is missing between "HTTP" and "1.0". That is, change,

POST /cgi-bin/register.pl HTTP 1.0

to

POST /cgi-bin/register.pl HTTP/1.0

p. 499: In the first bold line on the page, a forward slash is missing between "HTTP" and "1.0". That is, change,

POST /cgi-bin/post-query HTTP 1.0

to

POST /cgi-bin/post-query HTTP/1.0

On p. 502, in item 1, change "you'll use send data to the CGI program" to "you'll send to the CGI program".

p. 506: In the first paragraph change java.io.Permission to java.security.Permission.

p. 509: In the first row of the table on this page, "! XPM2" should be "!XPM2", and should be placed in the ASCII column, not the hexadecimal column.

p. 510: In the first line of the code fragment at the bottom of the page, a forward slash is missing between "HTTP" and "1.1". That is, change,

HEAD /catalog/jfcnut/index.html HTTP 1.1

to

HEAD /catalog/jfcnut/index.html HTTP/1.1

p. 510: In the first line of the code fragment at the bottom of the page, a forward slash is missing between "HTTP" and "1.1". That is, change,

HEAD /catalog/jfcnut/index.html HTTP 1.1

to

HEAD /catalog/jfcnut/index.html HTTP/1.1

p. 512: In the first line of the code fragment at the bottom of the page, a forward slash is missing between "HTTP" and "1.1". That is, change,

OPTIONS /xml/ HTTP 1.1

to

OPTIONS /xml/ HTTP/1.1

p. 513: In the first line of the first code fragment in the DELETE section, a forward slash is missing between "HTTP" and "1.1". That is, change,

DELETE /javafaq/1999march.html HTTP 1.1

to

DELETE /javafaq/1999march.html HTTP/1.1

p. 514: In the first line of the large code fragment in the middle of the page, a forward slash is missing between "HTTP" and "1.0". That is, change,

PUT /hello.html HTTP 1.0

to

PUT /hello.html HTTP/1.0

p. 514: In the first both code fragments as well as in the third text paragraph, a forward slash is missing between "HTTP" and "1.1". That is, change,

TRACE /xml/ HTTP 1.1

to

TRACE /xml/ HTTP/1.1

p. 516: At the end of the first paragraph of the "Handling Server responses" section, delete ", and follows the response MIME header".

p. 516: In the code fragment in the middle of the page, a forward slash is missing between "HTTP" and "1.1". That is, change,

HTTP 1.1 200 OK

to

HTTP/1.1 200 OK

The same problem reoccurs in the last code fragment on the page. That is, change,

HTTP 1.1 404 Not Found

to

HTTP/1.1 404 Not Found

p. 516: In the second code fragment on the page, a forward slash is missing between "HTTP" and "1.1". That is, change,

HTTP 1.1 301 Moved Permanently

to

HTTP/1.1 301 Moved Permanently

p. 520: In Example 15-10 change, "HTTP 1.x" to "HTTP/1.x"

p. 522: In Table 15-3, in the 406 row, "Allow field of the MIME request header" should be "Accept field of the MIME request header".

p. 523: In the first code fragment change, "HTTP 1.x" to "HTTP/1.x"


[ Java Network Programming Corrections | Java Network Programming Home Page | Table of Contents | Examples | Order from Amazon ] ]

Copyright 2001, 2003, 2004 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified May 10, 2004