How to redirect to the login page when the session expires?
问题 I have three JSF 2.0 web modules and I need to redirect to the login page when the session expires. I have tried it using a HttpSessionListener , it is calling the sessionDestroyed() event method, but I am not able to forward/redirect the request in there. I think it is becasue there are no HttpServletRequest and HttpServletResponse objects. I also tried it using a PhaseListener , but it results in a "too many redirects" error in the webbrowser. public class SessionListener implements