Tuesday, February 09, 2010

Something about requestScope.

I should first mention, Frank Nimpihus has an excellent viewlet on "How - to bookmark view activities in a taskflow".
Edit: I started off to address the bit about having a bookmarkable page with parameters using just the requestScope.
I started this intending to get hold of an http request parameter via adf requestScope. Turned out, the whole request URL is actually nested deep inside a requestScope object. See this: 

I then wrote this piece of code in a Filter -
ADFContext.getCurrent().getRequestScope().put("adfItemId", servletRequest.getParameter("ItemId"));
Expecting to see the value via #{requestScope.adfItemId}  on my page. That was not to be. Only digging deeper through the debugger unearthed what you see in the above screeshot.
I finally got over this and arrived at the below steps to achieve a bookmarkable page with parameters (almost identical to the viewlet linked above, except for the use of requestScope):
Step 1. Create a requestScoped 'bean' in the unbounded taskflow containing the bookmarkable page.



Step 2. Set the ItemId request parameter (set in the URL) in the requestScope parameter



Step 3. Access the value:













No comments: