You can probably fake out a server call with some JavaScript.
(This is just off the top of my head, I'll let you try to implement it)
Code:
body onbeforeunload="saveInformation();"
.
.
.
script
function saveInformation() {
var srvrCall = new Image();
srvrCall.src = "http://url & parameters for your server side code";
}
/script
That's it in a nutshell. When you try to close the page the saveInformation function will get called. It will create an image object in JavaScript and set the source to whatever URL you want. The browser will naturally make a call out to that URL to try to retrieve the image. You can put your parameters on there and call your backend server code. Your code will get executed and the page will close.
I've done similar things before, using Java on the back end, with good results.
HTH.