I want to do url tracking using a filter. I want to build up a string of delimited servlet names and insert then into a database. the tables would then be deleted every so often.
What type or is there an example i can use of a listener that will trigger the insert when the user closes the browser, loggs out, or the session expires?
John Schretz wrote:...What type or is there an example i can use of a listener that will trigger the insert when the user closes the browser, loggs out, or the session expires?
thanks in advance
john
trigger when the user closes the browser? None. You may find some javascripts that can be used to make a new request to the server informing it that the browser is being closed.
trigger when the user logs out? Depends how you log out. If you invalidate a session when they log out then see below.
Steve Luke wrote:
trigger when the user closes the browser? None. You may find some javascripts that can be used to make a new request to the server informing it that the browser is being closed.
Even then, this isn't going to be crossbrowser compatible as at least Opera doesn't support it. Even then though, I won't use it. What if the user disabled Javascript? It can never be as reliable as you could do at the server side. Implementing the HttpSessionListener is the right approach, yes.
Bauke Scholtz wrote:
Even then, this isn't going to be crossbrowser compatible as at least Opera doesn't support it. Even then though, I won't use it. What if the user disabled Javascript? It can never be as reliable as you could do at the server side. Implementing the HttpSessionListener is the right approach, yes.
But when its possible to get the information close enough, why not get it. Otherwise, Listener is there in place.
Moreover, JavaScript disabled is not really the case to consider, IMHO, if not there as a requirement exclusively.
Sorry for the late response I have been really busy
Just wanted to say thank you and i will look into HttpSessionListener I will post any results i come up with