Re: Pretty Faces with Spring Security and primefaces

Splash Forums PrettyFaces Users Pretty Faces with Spring Security and primefaces Re: Pretty Faces with Spring Security and primefaces

#22589

soroor ash
Participant

Thank you christian :)

i change pretty:manag to pretty:manage but not redirect.

if used login method Instead doLogin(), in LoginBean:

public void login(ActionEvent actionEvent) {
RequestContext context = RequestContext.getCurrentInstance();
FacesMessage msg = null;
boolean loggedIn = false;

if(username != null && username.equals("rod") && password != null && password.equals("a564de63c2d0da68cf47586ee05984d7")) {
loggedIn = true;
msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Welcome", username);
} else {
loggedIn = false;
msg = new FacesMessage(FacesMessage.SEVERITY_WARN, "Login Error", "Invalid credentials");
}

FacesContext.getCurrentInstance().addMessage(null, msg);
context.addCallbackParam("loggedIn", loggedIn);
}

then say message welcome and close dialog and no get seesion . but if add this line in method:

try {
doLogin();
} catch (IOException e) {
e.printStackTrace();
} catch (ServletException e) {
e.printStackTrace();
}

then not say message and not close dialog and not go to adminPage.xhtml :((((((

I think should be the other way getSession for login but I do not know.

please help me .

Thank you :)