Obviously, the doGet
method has a return type of void, so, it doesn\'t return anything. In this sense, I\'m using the word \"return\" to mean send the response
Yes, the response stream is flushed and closed when doGet() finishes executing.
Keeping UI threads occupied for extended periods of time violates Java Enterprise best practice.
Recommend you rather return immediately if nothing to respond, and implement a timer on the client (browser) side to poll the server for results every so often.