ViewExpiredException not thrown on ajax request if JSF page is protected by j_security_check

I was able to reproduce your problem. What is happening here is that the container invokes a RequestDispatcher#forward() to the login page as specified in security constraint. However, if the login page is by itself a JSF page as well, then the FacesServlet will be invoked as well on the forwarded request. As the request … Read more

Performing user authentication in Java EE / JSF using j_security_check

I suppose you want form based authentication using deployment descriptors and j_security_check. You can also do this in JSF by just using the same predefinied field names j_username and j_password as demonstrated in the tutorial. E.g. <form action=”j_security_check” method=”post”> <h:outputLabel for=”j_username” value=”Username” /> <h:inputText id=”j_username” /> <br /> <h:outputLabel for=”j_password” value=”Password” /> <h:inputSecret id=”j_password” /> … Read more