Reply To: Redirect to current view with updated parameter

Splash Forums PrettyFaces Users Redirect to current view with updated parameter Reply To: Redirect to current view with updated parameter

#26463

This can probably be solved simply by using the org.ocpsoft.rewrite.faces.navigate.Navigate utility:

public String switchToCourse(String coursename) {
        Course courseRequest = this.getControllerUser().getUser().findCourseParticipationByName(coursename);
        if (courseRequest != null) {
            this.getControllerUser().setUserCourseParticipation(courseRequest);
            
            return Navigate.to("/faces/home.xhtml").with("course", coursename).build();
        } else {
            return null;
        }
    }
}