Create a Simple JSF 2.0 Page flow using Managed Bean

This section, we walk through creating a simple JSF page navigation using managed bean. I have used two XHTML pages in this example; that is index page and home page. When a user clicks a button on the index page, the page moves to the home page.

Managed Bean, Happyday.java

This Java class has a getter method returns a value home.

 

index.xhtml

This file has a button where action attribute points to the managed bean getter method getText which returns a value home. We have an XHTML file with the same name home, so when a user clicks the button the XHTML page automatically forwards the response to home.xhtml.

 

The home.xhtml

 

 

Deploy the project to any servlet container such as Tomcat and test the Project

Index page

022516_0548_SimpleJSF2P1 How to Create a JSF Page flow using Managed bean

Home Page

022516_0548_SimpleJSF2P2 How to Create a JSF Page flow using Managed bean

Download Source Code: JSF Managed Bean Page Flow

govindan How to Create a JSF Page flow using Managed bean
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 JSF Page flow using Managed bean
Connect me
By | 2017-06-08T21:53:40+00:00 February 25th, 2016|Categories: JSF|0 Comments
Like us on Facebook.
Connect!