JSF page redirecting from java bean
问题 Is there some way how to redirect page to other page from Java method? I'm able only to forward it using: FacesContext.getCurrentInstance().getExternalContext().dispatch("/foo.xhtml"); or using navigation-rules of faces-config.xml . Do you have any ideas? 回答1: Not sure what you're after, but the ExternalContext#dispatch() does only a forward, not a redirect. You'd like to use ExternalContext#redirect() instead. externalContext.redirect("foo.xhtml"); or even external (which is not possible