I have a JSF 2.0 app that has a bean called agreement. This app has 4 pages in total: main.xhtml, details.xhtml, generation.xhtml and generationFailed.xhtml. The right order of navigation should be main.xhtml -> details.xhtml and given certain conditions, either generation.xhtml or generationFailed.xhtml.
The order has to be like that because in order to correctly display details.xhtml and the generation pages, a bean has to be built based on the user's input in main.xhtml.
The problem is that the customer can go directly to any of the pages by entering the URL address in the browser. So, when loading for example details.xhtml, it will throw an error because the agreement bean has several null attributes. I have to somehow know if the agreement bean's attribute is null (the attribute is called id), and if it is null, force a redirect to main.xhtml.
Any ideas?