I am trying to write a web server in Java (this is my first time so an extremely simple web server). I am not sure how to process the http get and post requests.
Write now all I have is a loop with a server socket excepting connections and using a BufferedReader to take in the incoming message (as text).
I know that you can extend a Servlet class and make use of
protected void doGet(HttpServletRequest servlet_request, HttpServletResponse servlet_response)
, andprotected void doPost(HttpServletRequest servlet_request, HttpServletResponse servlet_response)
but I cannot work out how to transform/extract a raw incoming message from the socket into the parameters needed for the doGet() and doPost().
Would someone be able to give a basic example and/or explanation of what to do?
Many thanks
Also, as an after thought, would it be simple to extend the web server to process JSP pages?
Any help is greatly appreciated.