-
Oct 4th, 2007, 04:07 PM
#1
Sharing session data between faces and webflow
I'm working in a portlet environment, and I need to share a session variable between a webflow and a jsf bean. I've tried the statements below in my webflow action, but the attribute cannot be found from the jsf bean.
context.getExternalContext().getSessionMap().put(T ARGET_PAGE_NAME, targetPageName);
context.getExternalContext().getGlobalSessionMap() .put(TARGET_PAGE_NAME, targetPageName);
From the jsf bean I was trying to retrieve the value with
String targetPageName = (String) getExternalContext().getSessionMap().get("targetPa geName");
The two portlets are in the same war so they should have a common session. The only way I've been able to get the attribute is using the application map which appears to be shared between all users.
Any ideas?
-
Oct 5th, 2007, 07:18 AM
#2
Sharing session data between faces and webflow
Looks like this is the trick.
From your webflow action:
context.getExternalContext().getGlobalSessionMap() .put(TARGET_PAGE_NAME, targetPageName);
From your jsf bean:
PortletSession session = (PortletSession) getExternalContext().getSession(false);
String pageRequested =
(String) session.getAttribute(TARGET_PAGE_NAME, PortletSession.APPLICATION_SCOPE);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules