I have an application which is written using jquery and Direct Web Remoting framework.The js file works as a controller - since all the button clicks are captured using jquery.
The DWR framework is used for navigating between Javascript and
Java and vice-versa.
This application has 4 tabs(not 4 urls - just 4 tabs within same url) one of which deals with managing users.
Now I have a requirement (and which I missed to see earlier) wherein if user A deletes user B while user B is using our application on his own machine,user B should be logged out on any button press or any action that he performs.
Remember,all button clicks are captured through jquery functions e.g.
$("#userSaveBtn").click(function() { ..stuff....}
So in other words,I have to check on every button press,if current user exists in db or not .If he does not exist,he needs to be logged out.
One solution can be to write a function using jquery and DWR to check this and direct user to logout screen but it would be tedious to call this function on every button press.
Is there any way I write this function and don't have to call it always?If not,any other better solution?
Thanks