Embedded Java HTTP Servers

There seem to be a few extremes with the support of embedded Java HTTP servers. I have seen minimalist approaches like NanoHTTPD, and using the com.sun.net.httpserver package to attempt to embed Jetty and Tomcat. The ideal embeddable HTTP server will be implemented in such a way that it can be launched through Executor and get support for Servlet / JSP, but otherwise you should allow the use of its parent's registrar and allow the integration of its JMX intercepts.

Likewise, it should also be fairly modular, where you may be able to NOT include certain functionality. Has anyone come across any Java HTTP servers with this feature?

+3
source share
4 answers

I think grizzlies are the perfect solution for you. https://grizzly.dev.java.net/ . Out of the box, it's just an NIO server, but there are different packages with support for HTTP, Servlets \ JSP, etc.

+2
source

jetty :

+10
source

( ) Jetty, - , Jetty OSS, . Jetty - , ( 2001 ), .

+2
source

The question is how much functionality do you need. Small ones usually only support HTTP requests, where you may need a servlet API, https communication, web applications, etc. Jetty is very modular, so you can assemble what you want.

0
source

Source: https://habr.com/ru/post/1706715/


All Articles