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 home.jsp
page.
Copy the home.jsp.txt
file from the folder workshop-JSF-tutorial/web/Resources
to pages folder and
rename it to home.jsp page. 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 uses it to show
localized text.
6.1. Define Navigation rule
Open the faces-config.xml file from the WEB-INF/config
folder.
Right-click Navigation Rules under the Faces Config Tags
list. In pop-up menu select New Navigation
Rule…
In Navigation Rule
Tag dialog click the icon
for Source Page and choose the file register.jsp.
This will add navigation rule for register.jsp as source page.
6.2. Add Navigation Case for Navigation Rule
Right-click the navigation rule pages/register.jsp
and select New Navigation Case…
In Outcome
field type success
Click the icon
for Destination Page 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 submit button in register.jsp page.
6.3. Editor view of faces-config.xml
Workshop offers the 2-way split-pane
editor view for the JSF configurations file faces-config.xml. The view is synchronized between the two editors.
6.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: