Previous Next vertical dots separating previous/next from contents/index/pdf

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.

Copy the home.jsp.txt file from the folder workshop-JSF-tutorial/web/Resources to the pages folder and rename it as: home.jsp. 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.

4.1. Define Navigation rule

  1. Open the faces-config.xml file in the WEB-INF/config folder.
  2. Right-click Navigation Rules under the Faces Config Tags list. In pop-up menu select New Navigation Rule.
  3. In the Navigation Rule Tag dialog click the icon for Source Page and choose the file register.jsp.


  4. This will add navigation rule for register.jsp as source page.

4.2. Add Navigation Case for Navigation Rule

  1. Right-click the navigation rule pages/register.jsp and select New Navigation Case.

  2. In the Outcome field type success.
  3. Click the icon for Destination Page and choose the file home.jsp.
  4. Save the faces-config.xml file.
  5. Note that from the Problems view the warning message disappeared as the outcome success matches with the logical outcome returned by the action of submit button in register.jsp page.

4.3. Editor view of faces-config.xml

Workshop offers a sychronized 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:

 

Skip navigation bar   Back to Top