I have a requirement to develop and form based login module using
JSF 1.2. However, I am unable to understand like how to specify the success page in the navigation case. Below code snippet would help in understanding the issue. I am using
Tomcat server for development.
If I access any protected resource like myhome.faces, initially I am pointed to login.faces to enter username and password and once authenticated I will be landed to myhome.jsp page. However, in case I enter wrong credentials, since I pointed it again back to login.faces with error as query
string, I am landed to same page displaying error message. Below us my login.jsp
When I enter invalid credentials on url (
http://localhost:8080/sampleapps/login.faces), it is directed to below URL with error message.
http://localhost:8080/sampleapps/j_security_check
Below are my questions. Please help me.
1. In case of error credentials, I am directed to
http://localhost:8080/sampleapps/j_security_check with error message, again when entering correct credentials, I am directed back to login.faces and not to index.faces.
2. I am using JSF 1.2. how can I direct to success page or failure page in this scenario as it is done in springs/struts.