Passing objects between managed beans&controllers

Reading Time: 1 minute

in the source controller add your object into faces session map interface and identify it with a name

FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("category", category);

then in the target controller to acquire the object do the following

Category category = (Category) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("category");

Leave a Reply

Your email address will not be published. Required fields are marked *