Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to initialize session scoped managed bean with request parameter

843844Jul 29 2008 — edited Jul 29 2008
I'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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2008
Added on Jul 29 2008
6 comments
1,343 views