4. Define Page Navigation Rules
You have noticed the warning error The Navigation
outcome "success" returned from the "registerUser" action
method is not valid from this page.
It shows the warning because we have not defined navigation rules for the register.jsp
page. On successful registration the user will be navigated to the home.jsp
page.
4.1. Define Navigation rule
- Switch to the Project Explorer view.
- Copy the home.jsp.txt file
from the folder workshop-jsf-tutorial/web/Resources to
the pages folder.
- Rename it as: home.jsp.
(Right-click the file and select Refactor > Rename.) Also add key-value pairs
from the file workshop-jsf-tutorial/web/Typing_Aid/application_properties_2.txt to
the application.properties file. The home.jsp page
uses these key-value pairs to show localized text.
- Open the faces-config.xml file in the WEB-INF/config
folder.
- Right-click Navigation Rules under the Faces Config
Tags list. In pop-up menu select New Navigation Rule.

- In the Navigation Rule Tag dialog click the icon
next to the Source Page field and choose the file register.jsp.
- Click OK.

This will add navigation rule for register.jsp as source
page.
4.2. Add Navigation Case for Navigation Rule
- Right-click the navigation rule pages/register.jsp and
select New Navigation Case.

- In the Outcome field type success.
- Click the icon
next
to the
Destination Page field and choose the file home.jsp.

- Save the faces-config.xml file.
- Note that from the Problems view the warning message
disappeared as the outcome success matches
with the logical outcome returned by the action of the submit button in register.jsp
page.
4.3. Editor view of faces-config.xml
Workshop offers a synchronized 2-way split-pane editor view for the JSF configurations
file faces-config.xml.

4.4. Visualize faces-config.xml using the Navigation view
The faces-config.xml file can be visualized in a Navigation
view. Upon selection or editing, the Navigation view is synchronized
with the source in real-time. There is no need to tab between views. With the
Workshop 2-way, split-pane view, you can see (and edit) them both at the same
time!

Click one of the following arrows to navigate through the tutorial:
Still need help? Post a question on the Workshop
newsgroup.