Re: How to redirect with parameter ?

Splash Forums PrettyFaces Users How to redirect with parameter ? Re: How to redirect with parameter ?

#22407

Another option would be to return something like this:

return "/faces/pages/users/editUser.xhtml?faces-redirect=true&id="+userObj.getId();

@lincoln: This should work, right? I think you mentioned this on the forums some time ago.

Actually I think we could perhaps create some builder-like approach to simplify the task of creating the correct outcome. What about something like this:

return OutcomeBuilder.mapping("edituser").with("id", userObj.getId()).toOutcome();

or:

return OutcomeBuilder.mapping("edituser").param(userObj.getId()).toOutcome();

or:

return OutcomeBuilder.viewId("/faces/pages/users/editUser.xhtml").with("id", userObj.getId()).toOutcome();

What do you think?