Does NavigationHandler.handleNavigation () clear a flash?

I am using JSF2.0 Mojarra 2.0.2.

I have a method that registers the user and places a message about exiting the flash memory, is sent to the login page (which has a div that displays the flash). However, when I use the navigationHandlers handleNavigation method for some reason, Flash does not display. I have a similar method that sends the user to the login page if he / she is not logged in.

If I process navigation via the h: link and just call the logout method directly, the flash is displayed as usual, but if I use the handleNavigation () method, for some reason the flash drive is cleared.

This code:

public void performLogout()
{
    getFacesContext().getExternalContext().invalidateSession();
    setCurrentUser(null);
    getFlash().put("notice", "Successfully logged out.");
    super.getFacesContext().getApplication().getNavigationHandler()
            .handleNavigation(getFacesContext(), null, "login");
}

Is there a way to keep the flash while navigating this way?

thank.

: , , , Flash , xhtml : http://java.net/jira/browse/JAVASERVERFACES-1635

+3

Source: https://habr.com/ru/post/1746404/


All Articles