code: @Override
      public void setKeepMessages(boolean keepMessages)
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          ExternalContext externalContext = facesContext.getExternalContext();
          Map<String, Object> requestMap = externalContext.getRequestMap();
          requestMap.put(FLASH_KEEP_MESSAGES, keepMessages);
      }
docs: If this property is true, the messages should be kept for the next
  request, no matter if it is a normal postback case or a POST-
  REDIRECT-GET case.
  
  Note that we don't have to store this value for the next request
  (like setRedirect()), because we will know if it was true on the
  next request, if we can find any stored messages in the FlashMap.
  (also see _saveMessages() and _restoreMessages()).