myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jed Smallwood <>
Subject [Trinidad] Understanding Page Flow Scope and its relation to the page-flow-scope-lifetime setting
Date Tue, 07 Jul 2009 18:09:09 GMT

I'm currently having a problem in which my page flow scope is disappearing
when I am dealing with multiple windows.  I believe this is related to the
page-flow-scope-lifetime setting in the trinidad config and I would like to
get confirmation on what I have observed and then possibly some
recommendations on how to prevent it.

To keep things simple consider my page-flow-scope-lifetime is set to 3.  I
log into my application at which point the main page is rendered and a page
flow scope entry is created.  My page flow scope lifetime list then has one
entry representing the first page.  Below is my conceptual representation of
the 3 lifetimes.  "1" is my first page and "_" are unused values.

| 1 | _ | _ |

The user then interacts with the main page in the application and they cause
a second window to open (javascript is being used to open this window as
opposed to trinidad dialog navigation rules... I'm not sure if this
matters).  Page flow scope is used to transfer state across this navigation,
and it works as expected.  Now the page flow scope looks like this ("2"
represents the page flow scope for the second page):

| 1 | 2 | _ |

The user then performs an action on the second page; toggling a button for
example.  This creates another entry.

| 1 | 2 | 2 |

The user then performs another action on the second page.  This action
pushes out the first page's state.

| 2 | 2 | 2 |

Now an action occurs on the first page (the second page still exists and can
be interacted with) and we get a Null Pointer Exception because the expected
data in the page flow scope for the first page is no longer there.  The
returned page flow scope is actually an empty hash map.  Which would seem to
say that the page flow scope id that the first page was attempting to use
was not in the lifetime list for this user's session so a new empty entry
was created.

Is this a correct representation for how a user's page flow scope and the
corresponding page-flow-scope-lifetime value interact?

It seems that this null pointer exception can be avoided if the second
window is created with a new session, but that is something we don't want to
do.  This problem becomes much worse when we start to get more secondary
pages launched with concurrent interaction.

Is this even a valid way to utilize page flow scope or is the technique
being butchered with this multiple active window approach?  Are there
recommended ways to get around this behavior outside of increasing
page-flow-scope-lifetime to some really large value?

Thanks for you help,

View raw message