I am just curious how to implement a small server program in Java SE?
The program is listening on port 80 and ready to retrieve an InputStream object, but is there any function I can use to convert an InputStream into an HttpRequest object (something like Servlet)?
After that, how can I craft an HttpResponse object and send the data back to the browser?
Conclusively, I am just looking any framework that can help me parse the HTTP format into an object, or from an object into an HTTP response stream.
(I know Java EE will be the better solution, I just want to test something on Java SE)
Look no further than Jetty in this case. It is written for exactly that purpouse – embedding an HTTP server into your application. But probably won’t get you an HttpRequest object, but perhaps something similar that should suit your needs.