title: Save messages to flash to display them after redirect
body: <pre><code> Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash();
   flash.setKeepMessages(true);
   getJsfContext().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO, "My message.", ""));
  
   getJsfContext().getExternalContext().redirect("index.xhtml");
  </code></pre>
  
  <p>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?</p>
  
  <p><code>getJsfContext()</code> is my function to get <code>FacesContext.getCurrentInstance()</code></p>