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


soroor ash

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 {
} catch (IOException e) {
} catch (ServletException e) {

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 :)