How to initialize session scoped managed bean with request parameter
843844Jul 29 2008 — edited Jul 29 2008I'm working with a proprietary framework that is built upon JSF. The framework centers around a session scoped managed bean (called context) that takes another managed bean (that represents a resource) as a parameter. I've modified the application to be able to select from multiple resource beans from a drop-down list.
The web app would always launch with the resource that was defined in the faces-config.xml file for the context object, and then I could programatically change it through my backing bean. I want to be able to specify which resource I want to use when I initially access the page, instead of always manually loading the resource defined as the parameter in the faces-config.xml file. My initial thought was to populate that property directly from the URL parameter using the #{param} tag, but it bombs out since it's a request scoped variable.
How can I pull a parameter from the URL and set it as the value of a parameter for my session-scoped managed bean before my main JSF page attempts to render the context with the resource?