Results 1 to 2 of 2

Thread: Sharing session data between faces and webflow

  1. #1
    Join Date
    Aug 2007
    Location
    Athens, GA
    Posts
    5

    Default 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?

  2. #2
    Join Date
    Aug 2007
    Location
    Athens, GA
    Posts
    5

    Default 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
  •