I’m trying to wrap my head around navigation rules in JSF2.0. If I have a button with an action method, is the purpose of the navigation rule to move me to a ‘results’ page? This seems too simple I guess, couldn’t you just f:ajax and update a result area on the page? What is the real purpose of navigation rules and how can one effectively use them in JSF 2.0?
Bonus points for metaphors that use ponies.
The point of navigation rules is that they allow the server to decide, based on the data in a request, which view to show next – a results page, an error page, the next of several possible following pages in a workflow, whatever.
They’re not always useful – most applications only have linear workflows and show errors in-page so that you never really need navigation rules. I’ve always considered it a bit weird that such an (in my experience) rarely-useful feature became a core concept in Struts and JSF. But it would certainly be useful for a workflow with lots of branching logic.
As for AJAX – that’s a different use case. If you’re switching to a completely different view, you should do a full update rather than use AJAX.