Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash();
flash.setKeepMessages(true);
getJsfContext().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO, "My message.", ""));
getJsfContext().getExternalContext().redirect("index.xhtml");
This is my backing bean. I want to store messages to flash and display it after redirect. This doesn't work. Nothing happens. What is the solution?
getJsfContext()
is my function to get FacesContext.getCurrentInstance()