Created
March 29, 2012 20:49
-
-
Save fabriciocolombo/2243632 to your computer and use it in GitHub Desktop.
JSF redirect url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void redirect(String path) throws Exception { | |
FacesContext ctx = FacesContext.getCurrentInstance(); | |
ExternalContext extContext = ctx.getExternalContext(); | |
String url = extContext.encodeActionURL(ctx.getApplication().getViewHandler().getActionURL(ctx, path)); | |
extContext.redirect(url); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment