views:

261

answers:

4

There seems to be multiple extremes when supporting embeddable Java HTTP servers. I have seen minimalist approaches such as NanoHTTPD and leveraging the com.sun.net.httpserver package to attempting to embed Jetty and Tomcat. The ideal embeddable HTTP server would be implemented such that it could be launched via Executor and come with Servlet/JSP support but otherwise should allow for using the logger of its parent and allow for integrating its JMX hooks.

Likewise, it should also be modular enough where you can have the option of NOT including certain pieces of functionality. Has anyone ran across any Java-based HTTP servers with this characteristic?

+10  A: 

jetty:

dfa
A: 

The question is how much functionality you need. The small ones typically only supports http requests, where you may want servlet API, https communications, web applications, etc. Jetty is very highly modular so you can put together what you want.

Thorbjørn Ravn Andersen
+2  A: 

I think grizzly is an ideal solution for you. https://grizzly.dev.java.net/ . Out of box it's simply a NIO server, but there are different packages with support for HTTP, Servlets\JSP and etc.

jusio
+2  A: 

I couldn't afford the overhead (in size) of even a minimal Jetty, so I wrote my own framework - I can't remember if Jetty had OSS licensing encumberances which ruled it out for us. But, at the time, I was highly impressed with Jetty's design and highly modular architecture - it was easily the best option I explored (back in 2001 or so) and I recommend it.

Software Monkey
Is your framework Open source :)?
Alfred
@Alfred: Sorry, no - it's the proprietary property of the company that employs me.
Software Monkey