Bizarre behaviour from my server

Discussions

Web tier: servlets, JSP, Web frameworks: Bizarre behaviour from my server

  1. Bizarre behaviour from my server (2 messages)

     I am tryin to build an application, which is essentially a server. It is possible to request html files from the server, and I have also implemented enough of the servlet specs to be able to run a couple of servlets as well.

    Any requests for static html work without problems, but if I ever make a request for a servlet (via the public service() method) then I seem to get multiple requests being sent and the server fails to return anything.

    I simply cannot see what could possibly be causing this - the server used to work perfectly and I can't see what I've done that may have stuffed anything up. There are no redirects (that I'm responsible for) and I've used Netscape, Mozilla and IE as browsers.

    Does anyone have any idea what could be causing this? Anyone come accross anything similar?

    There is too much code to show you snippets, but feel free to ask any questions about the code I have written and I will post relevant snippets.
  2. The problem seems to occur when I call the service() method of my servlet.
    <p>This is the code including the call:
    <p><i>LombokServletRequest servletRequest = new LombokServletRequest(request, originalRequest, headers);<br>
    LombokServletResponse servletResponse = new LombokServletResponse(out, pout);<br>
    try {<br>
    adminServlet.service(servletRequest, servletResponse);<br>
    pout.flush();<br>
    out.flush();<br>


    }
    </i>
    <p>The request is created by passing in the current request path, the complete body of the request and the headers as a HashMap. The response simply gets passed an output stream and a PrintWriter for the output.

  3. I've began to write a HTTP server for a couple of times (neither ever reached "stable":) and I think I remember a browser feature such that if you fail to send a response (e.g. close the Socket.getOutputStream() object), the browser re-sends the request over and over again until a certain try-this-many-times-before-quitting value is reached.

    Not sure though. Just talking out loud.