April 25th, 2003, 09:54 AM
Will the jsp execute when a user closes browser?
I have a jsp application that integrates with a database. I just want to know what happens if a user clicks a link and closes the browser while the request is through. Here there are 2 to 3 scenarios. In my application, the jsp returns nothing but for putting the get parameters from the link into the database. What happens when a user closes the browser/click stop button immediately after clicking the link. In IE we see a status bar at the bottom. What happens when a user closes the browser/cliks stop button while it is halfway through? Would the database be updated?
Also, I've tried some links on yahoo. When we click link 1 and immediately click link 2 the result is random. I believe once the request reaches the web server, the transaction is complete.
What happens internally at the jsp?
I would greatly appreciate if you can give me some information regarding this. Thanks!!
April 26th, 2003, 12:42 PM
This is a very good question. When you click the stop button in a browser, I believe it sends a stop packet (RST) to the server telling it that it does not need the previous request. Now, generally an http server would just stop the transaction. However, this begs the question of what the app server does? It may stop the jsp in it's tracks from continued processing, but I think more likely is that it would let the jsp run to completion but not send out any data to the client (since the client said they don't want it). If the app server receives a RST packet before it has started the jsp, my guess is that it simply does not run the jsp. This is all speculation of course.
I would always assume that if a request has been made that whatever action was requested will be done. The only way to be sure is to make a script that takes several seconds to run and then hit the stop button after requesting it and see if it runs to completion. My guess is that if it starts it will finish.