Book Image

Mastering JavaServer Faces 2.2

By : Anghel Leonard
Book Image

Mastering JavaServer Faces 2.2

By: Anghel Leonard

Overview of this book

Table of Contents (20 chapters)
Mastering JavaServer Faces 2.2
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The JSF Life Cycle
Index

Configuring navigation


Starting with JSF 2, navigation became much easier. Navigation can be accomplished using:

  • Implicit navigation

  • Conditional navigation

  • Preemptive navigation

  • Programmatic navigation

We can talk for hours and hours about JSF navigation, but there are a few golden rules that save us from falling for the most common mistakes when we need to choose between GET and POST. It might be useful to know that:

  • It is recommended to use the GET request for page-to-page navigation, search forms, URLs that you want to be visible and bookmarkable, and, in general, for any idempotent request. By specification, GET, HEAD, PUT, DELETE, OPTIONS, and TRACE are idempotent.

  • For requests that shouldn't be bookmarkable, use the same view repeatedly (use forward, not redirect).

  • For requests that shouldn't be bookmarkable, but have bookmarkable targets, use POST and redirect.

Implicit navigation

Implicit navigation interprets navigation outcomes as target view IDs. The simplest implicit navigation case is...