164 total views, 3 views today

How to create a simple JSF navigation

In this section, we have described an example of a simple JSF navigation.  We have used two XHTML pages, that is index.xhtml and home.xhtml. When a user clicks the button in the index.Xhtml, the page move into home.xhtml.   Here below the page flow

 

Capture-6-300x142 How to create a simple JSF navigation

Simple JSF Page Navigation

Create index.xhtml  under your project WebContent directory

we have a commandButton where action attribute value to point to home.

 

Create home.XHTML under your project WebContent directory

 

Edit the navigation rule as similar to below in your faces-config.xhtml

 

JSF Project Structure

Capture-7 How to create a simple JSF navigation

JSF Project Structure

 

Test the Project

Deploy the project in Tomcat server and open the index.xhtml in a browser. You will end up with the screen like below >>  click the button home

Capture-8-300x82 How to create a simple JSF navigation

The page moves into home.xhtml

Capture-9-300x58 How to create a simple JSF navigation

 

Full Project Source Code: jsf project source code

govindan How to create a simple JSF navigation
Connect me

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply šŸ™‚
govindan How to create a simple JSF navigation
Connect me
By | 2017-06-08T22:24:03+00:00 February 21st, 2016|Categories: JSF|Tags: |0 Comments
Like us on Facebook.
Connect!