Re: Server action and redirection
No, the pages are independent. You are just setting the properties in the foreign bean to allow PrettyFaces to generate the correct URL to redirect the user to. Let me show this in an example.
Imagine a form some user submits and you want to take the user to a product details page after that.
Request 1 (POST-Request: The user submits the form)
– Your action method gets invoked
– You do whatever you want to do to process the postback
– Set the
productId property on the
– PrettyFaces reads the
productId from the bean and generates the target URL.
– PrettyFaces redirects the user to:
Request 2 (GET-Request: The browser requests
– PrettyFaces injects
123456 back into the
– Your action method of
ProductDetailPageBean gets invoked
You see how it works. It’s just an implementation of the Post-Redirect-Get Pattern .