This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have a page with a request scoped backing bean. One of the input parameters on this first page is created by navigating to another page. After leaving the second page I would like to return to the first page displaying its new value in the input field.
How can this be done leaving the first page backing bean in the request scope.
I could set the backing bean on the first page as session scope, but I would have to initialise the bean every time I navigate to that page.
At the very least, that value would have to be in the session. Everytime you navigate a new request is created, thereby creating a new backing bean. This is just basic J2EE. JSF handles repopulating values when a request doesn't navigate from the page. For example, when you press a button that uses the actionListener attribute, JSF knows that even though the scope is request, it needs to save the values and repopulate the backing bean accordingly because you aren't navigating away from the page.