M
mh
hi everyone,
this problem has been driving me crazy for days... I have built a
servlet that takes some simple parameters, performs some calculations
and then writes a HttpServletResponse response back to the client. The
code works *some* of the time - which sounds unusual, but the problem
is sometimes a HttpServletResponse is not sent back. The request always
reaches the server, and calculations are always carried out; similarly
the method to write the response is always called successfully. By
using some system out statements, I have noticed that:
- when the response is sent (XML, I'm using Ajax techniques)
successfully, the .isCommitted() method when evaluated in the doGet is
always true. When no response is sent, the same evaluates as false.
- using the response.toString() method, I got output such as:
org.apache.catalina.connector.ResponseFacade@ea85b4 or sometimes
org.apache.catalina.connector.ResponseFacade@627b5c
as a typical response. I sit there and click send several times to see
what happens, and I've noticed that responses are NEVER sent when
subsequent responses have different memory addresses (e.g. @627b5c and
@ea85b4). Subsequent (relatively close together in time) submits all
work because - as mentioned - they have the same memory address.
I have purposely not included code because the code does work - in the
sense that it quite easily can form and send a response. I've read a
fair bit of material and am totally stumped on this. Is this a problem
with establishing/committing a response??
Thanks!
Matt
this problem has been driving me crazy for days... I have built a
servlet that takes some simple parameters, performs some calculations
and then writes a HttpServletResponse response back to the client. The
code works *some* of the time - which sounds unusual, but the problem
is sometimes a HttpServletResponse is not sent back. The request always
reaches the server, and calculations are always carried out; similarly
the method to write the response is always called successfully. By
using some system out statements, I have noticed that:
- when the response is sent (XML, I'm using Ajax techniques)
successfully, the .isCommitted() method when evaluated in the doGet is
always true. When no response is sent, the same evaluates as false.
- using the response.toString() method, I got output such as:
org.apache.catalina.connector.ResponseFacade@ea85b4 or sometimes
org.apache.catalina.connector.ResponseFacade@627b5c
as a typical response. I sit there and click send several times to see
what happens, and I've noticed that responses are NEVER sent when
subsequent responses have different memory addresses (e.g. @627b5c and
@ea85b4). Subsequent (relatively close together in time) submits all
work because - as mentioned - they have the same memory address.
I have purposely not included code because the code does work - in the
sense that it quite easily can form and send a response. I've read a
fair bit of material and am totally stumped on this. Is this a problem
with establishing/committing a response??
Thanks!
Matt