There is a page with the authorization form, after correctly filling in the login-password pair, go to the main page of the site and display an informational message that the authorization was successful. It should be noted that the transition to the main page occurs by a redirect request (in which way the redirect
<redirect/> occurs does not matter).
The message is placed in
FacesContext as follows:
FacesContext facesContext = FacesContext.getCurrentInstance(); FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, message, null); facesContext.addMessage(null, facesMessage);
The problem is that after the redirect
<h:messages />does not show an informational message. At the same time, if the redirect is not done, but confined to one POST request, an informational message is displayed.
Tried to activate
, but this mechanism helps to display a message, only on the current page, even if we return to it later, but on another page (at a different url-address),
<h:messages />cannot reach the message.
Accordingly, the question is - how to display an informational message after a redirect?
Maybe somewhere you need to specify the correct scope for
The project is spinning on Glassfish 3, Java EE 6, JSF 2.