In a fictitious web application …
- The user clicks a link
- The server starts to prepare the response, but it takes several seconds
- The user cancels the page load
What happens to the request? Does the server continue to prepare the response? Does the response arrive to the browser?
The server will continue to prepare the response. When it tries to send the response to the client, it’ll fail. When this actually happens will probably depend on the actual application server implementation, whether the response is buffered etc.
In Java EE app servers (Tomcat and WebLogic, probably others as well), you’ll get the following exception: