In JSF2(v2.3.0-m09), is there any way to keep messages after redirecting page with different path?
For Example,
while in /a/currentPage.xhtml, I'am adding a message and then redirect a page which is in different path like below:
FacesMessage message = new FacesMessage();
message.setSeverity(FacesMessage.SEVERITY_ERROR);
message.setSummary("sample mesage");
FacesContext context = FacesContext.getCurrentInstance();
context.getExternalContext().getFlash().setKeepMessages(true);
context.addMessage(null, message);
context.getExternalContext().redirect("/anotherPage.xhtml?faces-redirect=true");
In this case, I cannot see the message after located /anotherPage.xhtml.
Is there a way to do this?
NOTE: /anotherPage.xhtml includes messages tag as;
<h:messages globalsOnly="true" />