Simple JSF Page Redirect

By default, JSF forwards the page whenever a user requests a page from the server. Follow the steps if you want to redirect the page:

1. Add parameter faces-redirect=true at the end of the URL

2. In faces-config.XML, Add element <redirect/> in the navigation rule

In page forward, JSF does not change the URL in the browser but In page redirect, JSF changes the URL. We usually use page redirect to avoid form resubmission


01-2-300x173 JSF 2.0 Page Redirect

JSF Page redirect


In this example, we created index.xhtml & dashboard.xhtml.  When user clicks the button in index page, JSF redirects the page to dashboard. 






We  added parameter faces-redirect=true at the end of the URL and <redirect/> in navigation rule.

Managed Bean


Download Source Code:JSF Page Redirection

govindan JSF 2.0 Page Redirect
Connect me


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 JSF 2.0 Page Redirect
Connect me
By | 2017-10-25T21:15:56+00:00 February 27th, 2016|Categories: JSF|Tags: |Comments Off on JSF 2.0 Page Redirect
Like us on Facebook.