This tutorial explains how to navigate from one jsp page to another jsp in JSF application. The page navigation in the JSF framework is controlled by the faces-config.xml. This file contains one or more navigation cases. You can map action from the commandButton to success.jsp and fail.jsp. Steps to navigate the jsp form using NetBeans IDE.
Step 1:- In the Projects window, double-click faces-config.xml to open the file in the Source Editor. In the toolbar above the file, click XML to display the file in plain XML.
Step 2:- Right-click anywhere in the file and choose JavaServer Faces > Add Navigation Rule. Type /login.jsp in the Rule from View field and optionally enter a description of the rule as figure below:
Step 3:- Right-click anywhere in the file and choose JavaServer Faces > Add Navigation Case. Type /login.jsp in the Form View and type success in Form Outcome and type /success.jsp in To View as figure below:
As per your requirement give another navigation rule. The faces-config.xml structure is as follows:
Liked it! Share this Tutorial