Since there is no ongoing session to be dropped (remember, the connection only lasts long enough for the server to accept a request and return a response), there's no way the server will know that the client went away.
Thank you "Tim" for reply, please give me solution for following point: 1) Window close or tab close event in jsp & servlet.
The closest you can get is to respond with a "you were timed out" response page if/when the client makes a request.
The other common thing people want to do is to notify the server that the client has closed a browser, window, or tab.
maintenance happens with the jsession Id, then what happens in that case?
When I hit my JSF servlet, and dont do any thing for 3 mins, then my customised session listener gets invoked and session Destroyed(Http Session Event http Session Event) is called.It will be removed from the server at that point, so any attempt to come in later will fail.Upon logging in using the custom login module, things work as expected - however, upon logging out by invalidating my session in a "logout" servlet where I use the request dispatcher to take me to the next page, I have things showing up on the page that shouldn't because they are enclosed in is User In Role blocks.At NO time is the server allowed to send a response to the client unless it's in response to a specific actual request and only one response is permitted per request.So you cannot have a server post a "you timed out" page to the client.