I am using spring security and i have a custom logout filter.
Now the issue is i haven't set any timeout in web.xml and if i keep the screen logged in for some time around 2 hrs or so and click logout i got NULL POINTER EXCEPTION inCode:public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { UserSessionMap sessionMap = UserSessionMap.getInstance(); String userId = authentication.getName(); sessionMap.invalidateUserSession(userId); notifyUserLogout(userId); sessionMap.printMap(); }
which i guess is due to automatic timeout authentication object becomes null and name couldn't be found. But in that case i will not be able to do DB clean up as required. Can someone please tell me how do i capture a timeout even and call the above method to do DB clean up.Code:String userId = authentication.getName();


