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
This is how I would go about this:
ServerSocket listening (probably on port 80).ServerSocket available to keep listening and accept other connections).Content-Type, etc.) and the HTML.I find it useful to use Firebug (in Firefox) to see examples of headers. This is what you want to emulate.
Try this link: - Multithreaded Server in Java