Use navigation rules if you want to create navigation from one
Faces JSP page to another in the same project. Navigation rules are the rules
you set for which page to go to when a certain outcome occurs on the original
page. For example, if a user receives an error message while trying to click
a Submit button, a navigation rule can automatically
navigate to a new page that tells the user how to fix the problem.
Note: If
you want to create navigation to external Web pages, use the Link component.
Drag the Link component to the page and then specify the external target and
label.
To create navigation rules:
At a minimum, you can select the component, then change return null
to return "alias" in the Quick Edit view. By default, the alias will be *,
which means a return code of anything (except null) will trigger that navigation
rule. You can set the return code for a given component in the Quick Edit
view. Select the Command event and in the right pane of the Quick Edit view,
specify at a minimum:
return"". This returns an empty string,
which triggers the rule based on *. If you have a specific alias set up (for
example, "success"), then the actions needs to return "success" to trigger
that navigation rule. You can make a navigation rule apply only to a specific
action (choose action in scope). You can have the navigation rule apply on
the current page or on all pages in the project. Note that unless you scope
it to a particular action, all actions use these navigation rules, whether
or not you have explicitly added them using the Properties view.
To learn
more about using navigation rules, do the following tutorial (especially the
exercise on using navigation rules):
Tutorial: Display dynamic information on Web pages with JavaServer Faces. This
tutorial will teach you how to design a dynamic Web site that functions as
a newspaper's classified advertising section. The Web site is a complete J2EE
Web application that uses JavaServer Faces (JSF) components and Service Data
Objects (SDO) components. The Web application uses JSF technology to create
dynamic Web pages that link to a database that stores classified advertising
data.Tutorial:
Display dynamic information on Web pages with JavaServer Faces. This tutorial
will teach you how to design a dynamic Web site that functions as a newspaper's
classified advertising section. The Web site is a complete J2EE Web application
that uses JavaServer Faces (JSF) components and Service Data Objects (SDO)
components. The Web application uses JSF technology to create dynamic Web
pages that link to a database that stores classified advertising data.