RFR: 8245095: Implementation of JEP 408: Simple Web Server

Daniel Fuchs dfuchs at openjdk.java.net
Tue Sep 14 16:51:08 UTC 2021

On Tue, 14 Sep 2021 12:38:19 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

>> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandlers.java line 128:
>>> 126:      * <p> {@code headers} are the effective headers of the response. The
>>> 127:      * response <i>body bytes</i> are a {@code UTF-8} encoded byte sequence of
>>> 128:      * {@code body}. The response {@linkplain HttpExchange#sendResponseHeaders(int, long) is sent}
>> Not sure what the javadoc looks like here, but it looks like the link is "is sent". Curious.
> Just a rewording, maybe.

Hmm... Maye that should be "The response headers *are sent*". The non-obvious technical details is that the response headers are sent before the body - as soon as you call  `sendResponseHeaders`. The link is here to provide a better understanding of the workings of the new Handler. The headers are sent by calling `sendResponseHeaders` on the HttpExchange.


PR: https://git.openjdk.java.net/jdk/pull/5505

More information about the core-libs-dev mailing list