HTTP Server is the modern way to provide Web Experience. However, Tomcat, Weblogic server and so on, are somehow weighted, especially for java utility application,
Many open source Web Server can be founded from http://java-source.net/open-source/web-servers. There are three light embedded Http Servers that maybe you can choose to embedded in your application.
· Nano: The smallest http server
Free, simple, tiny (1 java file!), nicely embeddable HTTP server in Java. It can provide some basis Http function.
http://nanoserver.sourceforge.net/
· Jetty: (Embedded)
Jetty is a 100% Java HTTP Server and Servlet Container. This means that you do not need to configure and run a separate web server (like Apache) in order to use java, servlets and JSPs to generate dynamic content. Jetty is a fully featured web server for static and dynamic content. Unlike separate server/container solutions, this means that your web server and web application run in the same process, without interconnection overheads and complications. Furthermore, as a pure java component, Jetty can be simply included in your application for demonstration, distribution or deployment. Jetty is available on all Java supported platforms. To use Embedding Jetty, there is simple tutorial for reference: http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty
· JDK 1.6 Http Server:
JDK 6.0 shipped a simple, but extendable Http Server by using class com.sun.net.httpserver.HttpServer. IBM developerworks site provides a easy steps on how to use this Http Server (Chinese) http://www.ibm.com/developerworks/cn/java/j-lo-jse62/index.html
| Size | Functionality | Support Servlet API | Extendibility | Configurable |
Nano | Tiny (1 File) | Limited | No | Difficulty | No |
Jetty (Embedded) | Middle | Rich Function | Yes | Flexible and extensible | Yes (XML Supported) |
JDK 1.6 Http Server | Embedded in JRE | Basic | No | Medium | No |
Any more light weight and good Http servers please add.