public final class JsfNavigationUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
forward(String path)
Forwards (dispatches) to the supplied path.
|
static javax.faces.application.NavigationHandler |
getNavigationHandler()
Convenience method to get the navigation handler.
|
static void |
handleNavigation(String fromAction,
String outcome)
Handles navigation by delegating to
NavigationHandler.handleNavigation(FacesContext, String, String)
except for the fact that this method adds "?faces-redirect=true")" to
the supplied outcome to perform an actual redirect. |
static void |
handleNavigation(String fromAction,
String outcome,
boolean redirect)
Handles navigation by delegating to
NavigationHandler.handleNavigation(FacesContext, String, String)
and optionally performs a redirect instead of a forward. |
static void |
redirect(String url)
Redirects to the supplied url.
|
static void |
refresh()
Refreshes the current page by redirecting to it.
|
public static void forward(String path)
path
- Context relative path to the specified resource, which must
start with a slash ("/") character.IllegalArgumentException
- When the supplied path is empty.NullPointerException
- When the supplied path is null.public static void refresh()
public static void redirect(String url)
url
- The url to redirect to.IllegalArgumentException
- When the supplied url is empty.NullPointerException
- When the supplied url is null.public static javax.faces.application.NavigationHandler getNavigationHandler()
public static void handleNavigation(String fromAction, String outcome)
NavigationHandler.handleNavigation(FacesContext, String, String)
except for the fact that this method adds "?faces-redirect=true")" to
the supplied outcome to perform an actual redirect.fromAction
- The action binding expression that was evaluated to
retrieve the specified outcome, or null if the outcome was acquired by
some other means.outcome
- The logical outcome returned by a previous invoked
application action (which may be null).public static void handleNavigation(String fromAction, String outcome, boolean redirect)
NavigationHandler.handleNavigation(FacesContext, String, String)
and optionally performs a redirect instead of a forward.fromAction
- The action binding expression that was evaluated to
retrieve the specified outcome, or null if the outcome was acquired by
some other means.outcome
- The logical outcome returned by a previous invoked
application action (which may be null).redirect
- True to perform an actual redirect, false to forward.Copyright © 2008–2018. All rights reserved.