Page reload with JSF faces-config.xml navigation rules

von tobonaut

To reload / refresh the current page via a navigation case, you have to provide the current view id in a related backing bean…

   public String getCurrentViewId()
        return FacesContext.getCurrentInstance().getViewRoot().getViewId();

… add this to the ** parameter of a navigation case in your faces-config.xml.


That’s pretty nice and simple snippet which helps you to prevent the usage of javascript calls like window.location.reload().