Interesting question... see comments below
On 4/23/2012 2:20 PM, LogicalGoetz wrote:
This may be a terribly novice question, but for each POST performed
by, say, a FormPanel, is there a subsequent HttpResponse generated by
the Servlet?
Obviously in standard situations this will play out as follows:
-client makes a POST request
-servlet handles the request
-servlet sends POST response
-client receives response
However, the situation I'm curious about is when something like this
occurs:
-client makes a POST request
-servlet handles the request
-client makes a POST request (this occurs a few times possibly)
-servlet handles these requests
-servlet generates responses
-client receives a series of responses (no guarantee on order)
From my current testing, it seems that if I have a FormPanel make
multiple POST requests while the servlet processes the requests, only
the first will ever generate a response. Is this the nature of Java
servlets, my client application (firefox), the http specification, or
possibly a coding blunder on my part?
for each post there should be a response = that's the http specification.
There is no limit in the java servlet spec to the number of simultaneous
requests. A server is normally expected to queue requests or reject them
("temporarily unavailable") but for each request there is still a
response - otherwise you'd get a timeout ("server not responding")
The servlet spec does provide alternative mechanisms for scheduling. A
good design will always assume that many requests can be concurrently
occurring and handle that accordingly - for example by using stateless
objects and transactional data stores. Avoid synchronous servlets like
the plague.
Either you are somehow *not* generating more than one post or you are
getting more than one response and overwriting the results.
Try:
1. watching the request/response with firebug or similar and do some
console logging of state in your client
2. Add some debugging output to the servlet to see whats happening there.
Then study the results and determine the causality! At least, that's
what I'd do.
HTH
Alan
Thank you in advance for any information,
Mike
--
You received this message because you are subscribed to the Google Groups "Google
Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.