New candidate JEP: 408: Simple Web Server
Christian Stein
sormuras at gmail.com
Sun May 9 06:47:12 UTC 2021
Motivated by the summary of JEP 408, I finally wrote a small blog[1]
about an in-memory http handler that I use for testing browsing-related
code via URL.open..., HttpClient, or other ways to read a resource.
The basic idea is to map a prepared response (http code, bytes, and
content-type) to a request path. For example:
"/index.html" -> "<html><body><h1>Index</h1></body></html>"
Perhaps, this path-asset(resource)-mapping abstraction is useful for
somebody else, too.
Cheers,
Christian
[1]:
https://sormuras.github.io/blog/2021-05-09-in-memory-http-server-handler
On Mon, Mar 29, 2021 at 9:16 PM <mark.reinhold at oracle.com> wrote:
> https://openjdk.java.net/jeps/408
>
> Summary: Provide a command-line tool to start a minimal web server
> that serves static files in the current directory. This low-threshold
> utility will be useful for prototyping, ad-hoc coding, and testing
> purposes, particularly in educational contexts.
>
> - Mark
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210509/5375883e/attachment.htm>
More information about the net-dev
mailing list