What's the easiest way to create a simple HTTP server with Java? Are there any libraries in commons to facilitate this? I only need to respond to GET/POST
, and I can't use an application server.
What's the easiest way to accomplish this?
Use Jetty. Here's a tutorial for embedding Jetty. (Here's an outdated tutorial.)
Jetty is pretty lightweight, but it does provide a servlet container, which may contradict your requirement against using an "application server".
You can embed the Jetty server into your application. Jetty allows EITHER embedded OR servlet container options.