I am looking for an elegant JSF way for this and wondered if there was a common practice for this.
When I move from one page to another, I want the new page to display FacesMessage in the h: message component (actually p: message ), but it should be the same) that was transferred from the last page.
So, for example, if the user clicks the "Create Document" button, he goes to a new page with success and displays a message about successful completion on a new page. I want all my database change operations to behave this way.
It seems that FacesContext clears all messages from navigation, so my nearest solution looks like this:
- Save the FacesMessage object in a bean session.
- Create a checkMessage method in the bean message that calls FacesContext.getCurrentInstance (). addMessage (..) and removes the message from the bean message.
- Put the EL link on checkMessage on the landing page.
- Put p: message on the landing page.
This seems a bit forced - is there a better way to do this?
source share