- java.lang.Object
-
- javax.faces.application.NavigationCase
-
- Direct Known Subclasses:
- NavigationCaseWrapper
public class NavigationCase extends Object
NavigationCase represents a
<navigation-case>
in the navigation rule base, as well as the<from-view-id>
with which this<navigation-case>
is a sibling.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor and Description NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, Map<String,List<String>> parameters, boolean redirect, boolean includeViewParams)
Construct a new
NavigationCase
based on the provided arguments.NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, String toFlowDocumentId, Map<String,List<String>> parameters, boolean redirect, boolean includeViewParams)
Construct a new
NavigationCase
based on the provided arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(Object o)
URL
getActionURL(FacesContext context)
Construct an absolute URL to this
NavigationCase
instance usingViewHandler.getActionURL(javax.faces.context.FacesContext, java.lang.String)
on the path portion of the url.URL
getBookmarkableURL(FacesContext context)
Construct an absolute URL suitable for a bookmarkable link to this
NavigationCase
instance usingViewHandler.getBookmarkableURL(javax.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean)
on the path portion of the url.Boolean
getCondition(FacesContext context)
Evaluates the
<if>
for this<navigation-case>
, if any.String
getFromAction()
Return the
<from-action> for this
<navigation-case>
String
getFromOutcome()
Return the
<from-outcome> for this
<navigation-case>
String
getFromViewId()
Return the
<from-view-id>
of the<navigation-rule>
inside which this<navigation-case>
is nested.Map<String,List<String>>
getParameters()
Return the parameters to be included for navigation cases requiring a redirect.
URL
getRedirectURL(FacesContext context)
Construct an absolute URL suitable for a "redirect" to this
NavigationCase
instance usingViewHandler.getRedirectURL(javax.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean)
on the path portion of the url.URL
getResourceURL(FacesContext context)
Construct an absolute URL to this
NavigationCase
instance usingViewHandler.getResourceURL(javax.faces.context.FacesContext, java.lang.String)
on the path portion of the url.String
getToFlowDocumentId()
If this navigation case represents a flow invocation, this property is the documentId in which the flow whose id is given by the return from
getFromOutcome()
is defined.String
getToViewId(FacesContext context)
Evaluates the
<to-view-id>
for this<navigation-case>
boolean
hasCondition()
Test if this navigation case has an associated
<if>
element.int
hashCode()
boolean
isIncludeViewParams()
Return the
<redirect>
value for this<navigation-case>
.boolean
isRedirect()
Return the
<redirect>
value for this<navigation-case>
.String
toString()
-
-
-
Constructor Detail
-
NavigationCase
public NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, Map<String,List<String>> parameters, boolean redirect, boolean includeViewParams)
Construct a new
NavigationCase
based on the provided arguments. See section JSF.7.4.2 for how aNavigationCase
is used by the standardConfigurableNavigationHandler
- Parameters:
fromViewId
- return fromgetFromViewId()
fromAction
- return fromgetFromAction()
fromOutcome
- return fromgetFromOutcome()
condition
- A string to be interpreted as aValueExpression
by a call togetCondition(javax.faces.context.FacesContext)
toViewId
- return fromgetToViewId(javax.faces.context.FacesContext)
parameters
- return fromgetParameters()
redirect
- return fromisRedirect()
includeViewParams
- returnisIncludeViewParams()
-
NavigationCase
public NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, String toFlowDocumentId, Map<String,List<String>> parameters, boolean redirect, boolean includeViewParams)
Construct a new
NavigationCase
based on the provided arguments. See section JSF.7.4.2 for how aNavigationCase
is used by the standardConfigurableNavigationHandler
- Parameters:
fromViewId
- return fromgetFromViewId()
fromAction
- return fromgetFromAction()
fromOutcome
- return fromgetFromOutcome()
condition
- A string to be interpreted as aValueExpression
by a call togetCondition(javax.faces.context.FacesContext)
toViewId
- return fromgetToViewId(javax.faces.context.FacesContext)
parameters
- return fromgetParameters()
redirect
- return fromisRedirect()
includeViewParams
- returnisIncludeViewParams()
-
-
Method Detail
-
getActionURL
public URL getActionURL(FacesContext context) throws MalformedURLException
Construct an absolute URL to this
NavigationCase
instance usingViewHandler.getActionURL(javax.faces.context.FacesContext, java.lang.String)
on the path portion of the url.- Parameters:
context
- theFacesContext
for the current request- Throws:
MalformedURLException
- if the process of constructing the URL causes this exception to be thrown.
-
getResourceURL
public URL getResourceURL(FacesContext context) throws MalformedURLException
Construct an absolute URL to this
NavigationCase
instance usingViewHandler.getResourceURL(javax.faces.context.FacesContext, java.lang.String)
on the path portion of the url.- Parameters:
context
- theFacesContext
for the current request- Throws:
MalformedURLException
- if the process of constructing the URL causes this exception to be thrown.
-
getRedirectURL
public URL getRedirectURL(FacesContext context) throws MalformedURLException
Construct an absolute URL suitable for a "redirect" to this
NavigationCase
instance usingViewHandler.getRedirectURL(javax.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean)
on the path portion of the url.- Parameters:
context
- theFacesContext
for the current request- Throws:
MalformedURLException
- if the process of constructing the URL causes this exception to be thrown.
-
getBookmarkableURL
public URL getBookmarkableURL(FacesContext context) throws MalformedURLException
Construct an absolute URL suitable for a bookmarkable link to this
NavigationCase
instance usingViewHandler.getBookmarkableURL(javax.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean)
on the path portion of the url. This URL may include view parameters specified as metadata within the view.- Parameters:
context
- theFacesContext
for the current request- Throws:
MalformedURLException
- if the process of constructing the URL causes this exception to be thrown.
-
getFromViewId
public String getFromViewId()
Return the
<from-view-id>
of the<navigation-rule>
inside which this<navigation-case>
is nested.
-
getFromAction
public String getFromAction()
Return the
<from-action> for this
<navigation-case>
-
getFromOutcome
public String getFromOutcome()
Return the
<from-outcome> for this
<navigation-case>
-
getToViewId
public String getToViewId(FacesContext context)
Evaluates the
<to-view-id>
for this<navigation-case>
- Parameters:
context
- theFacesContext
for the current request- Returns:
- the view ID that should be navigated to
-
getToFlowDocumentId
public String getToFlowDocumentId()
If this navigation case represents a flow invocation, this property is the documentId in which the flow whose id is given by the return from
getFromOutcome()
is defined. Implementations must override this method to return the value defined in the corresponding application configuration resources element. The base implementation returns the empty string.- Since:
- 2.2
-
hasCondition
public boolean hasCondition()
Test if this navigation case has an associated
<if>
element.- Returns:
true
if there's an<if>
element associated with this<navigation-case>
, otherwisefalse
-
getCondition
public Boolean getCondition(FacesContext context)
Evaluates the
<if>
for this<navigation-case>
, if any. The expression to be evaluated is passed into the constructor as a string. When the expression is evaluated, its value must be coerced into aboolean
per the normal EL coercion rules.- Parameters:
context
- theFacesContext
for the current request- Returns:
null
if there is no<if>
element associated with this<navigation-case>
, otherwise return the evaluation result of the condition- Throws:
any
- exceptions encountered during the process of evaluating the expression or obtaining its value.
-
getParameters
public Map<String,List<String>> getParameters()
Return the parameters to be included for navigation cases requiring a redirect. If no parameters are defined,
null
will be returned. The keys in theMap
are parameter names. For each key, the corresponding value is aList
of unconverted values.
-
isRedirect
public boolean isRedirect()
Return the
<redirect>
value for this<navigation-case>
. This will betrue
if the new view should be navigated to via aExternalContext.redirect(String)
-
isIncludeViewParams
public boolean isIncludeViewParams()
Return the
<redirect>
value for this<navigation-case>
. This will betrue
if the view parametets should be encoded into the redirect URL (only applies to redirect case)
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 17:21:50 Cette version de la page est en cache (à la date du 21/08/2025 17:21:50) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/faces/application/NavigationCase.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.