Is it possible for onbeforeunload() function to wait for ajax result and move to a jsp based on the resultvalue or atleast show a message before unloading?
onbeforeunload()
Use a synchronous XmlHttpRequest call ("AJAX" is a mis-nomer).