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
, andTRACE
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.