Error in page navigation need assistance to solve
Asked By
220 points
N/A
Posted on - 06/15/2012
Hi,
My login page navigates to next page once logged in. I want to validate it as only a single user can login. Same user name and password may valid, if the error message not displayed it means that the login details invalid. I tried it by this way.
if(this.getUserName().getValue()=="abcd" && this.getPassword().getValue()=="1234"){
userName=this.getUserName().getValue().toString();
password=this.getPassword().getValue().toString();
ADFContext.getCurrent().getSessionScope().put("userName",userName);
ADFContext.getCurrent().getSessionScope().put("password",password);
}else{
FacesMessage msg = new FacesMessage("Please check your login data");
msg.setSeverity(FacesMessage.SEVERITY_ERROR);
FacesContext.getCurrentInstance().addMessage(null, msg);
}
Â
Without showing the same login page after hitting the login button, the error message is displaying.Â
Â
Please someone give a help to solve this.
Â
Thanks a lot.