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!

Pass URL parameters between pages

843844Aug 21 2008 — edited Sep 16 2008
Hi Experts,

I have two pages, Page A and Page B, and I would like to pass an URL parameter of the form ?key=value when navigating from the one page to the next. In this way I would get access to the value on Page B without having to use a session-scoped JSF bean. I'd like to do something similar to Apache Trinidad's PageFlowScope where a collection of Maps is stored in a session-scoped bean and the request-scoped beans know which one to access based on the ID passed through the URL to them.

I tried the following code, but my Map Entry is dropped in between requests (i.o.w the Map does not contain my Entry after a request):
FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put("key", "value");
-and-
((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).setAttribute("test", "value");
I don't understand what I'm doing wrong, why I'm unable to retrieve my attribute.
Any and all help will be appreciated.

Thank you,
Ristretto
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2008
Added on Aug 21 2008
13 comments
774 views