myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blake Sullivan <>
Subject Re: PageFlowScopeProvider development request
Date Mon, 13 Sep 2010 16:19:57 GMT
  On 8/15/10 12:15 PM, Michael Kurz wrote:
> Hi Blake,
> I will look into this issue for Mark. So far, I have already looked at 
> some of the code involved here. Furthermore, I created a very basic 
> WindowManager implementation for playing around. As support for 
> windows is already implemented in the state handler, I managed to get 
> a simple version up and running (just for simple post backs).
> I think the first challenge here is to get a bullet-proof window 
> detection (if something like this is possible). Because if the state 
> is stored per window and the current window is lost we will definitly 
> run into problems (back button...).
> Do you already have some ideas or an implementation for this? I think 
> you mentioned something like this a while ago.
We wrote an implementation.  The tricky part is telling whether a new 
window has been created.  If you always ensure that all of your windows 
have names, then the only windows without names when they are first 
loaded will be windows created with control-N in Internet Explorer.  
Many people who write this kind of code either blow this off because it 
is hard to do or take the approach of realizing that the window is a new 
window only after the server has executed the JSF lifecycle on the new 
window thinking it is an existing window.  This later approach is an OK 
first cut but runs the very real risk of corrupting the state of the 
original window which now thinks that it has been newly navigated to.

-- Blake Sullivan
> regards
> Michael
> Am 06.08.2010 20:12, schrieb Blake Sullivan:
>> Mark,
>> I believe that what you really need is a default WindowManager
>> implementation in Trinidad. When a WindowManager is present, Trinidad
>> will store the view state under the windows and the view state can be
>> cleaned up when the window is closed.
>> -- Blake Sullivan
>> On 7/27/10 9:24 PM, Mark Badorrek wrote:
>>> Developers,
>>> I have a Trinidad application that has a few independant frames that
>>> operate in a non-modal fashion (The client needs tha app to work this
>>> way). All frames extensively use 'PageFlowScope'.
>>> Now PageFlowScope works well if you have a single frame, but gives no
>>> end of grief if you have multipe frames. This can be explained:
>>> Every time a user clicks on a page, Trinidad creates another viewstate
>>> object and shoves it onto the pageflowscope map. The map is stored in
>>> the HTTP session and is not limitless. You set the size of the map in
>>> web.xml. Once you start adding viewstates to an already-full map, the
>>> map starts discarding the oldest viewstates. Ususally this is not a
>>> problem (how many times could a user be expected to click the 'Back'
>>> button?) But if you have multiple frames, the user could spend
>>> 30minutes clicking in frame 'B', whilst the current viewstate of frame
>>> 'A' becomes older and older and eventually gets pushed out of the
>>> viewstate map. The the user clicks on frame 'A', the viewstate is not
>>> found and everything falls in a smoking mess.
>>> You can get around this by specifying a huge map-size in web.xml but
>>> this results in spectacular memory wastage for no really good reason.
>>> An alternative is to implement a new pageFlowScopeProvider that keeps
>>> separate maps for each frame. Trinidad does not have one of these
>>> out-of-the-box, but I have written one for my client. The problem is
>>> that it would be better to imlement this as a general solution in
>>> Trinidad so that others may benefit (and also that my client doesn't
>>> have to maintain it).
>>> I've not been involved in the project for a while but I'd like to get
>>> a solution in place for my client. Is there a preferred method to
>>> avoid the above problem? Or should the custome PageFlowScopeProvider
>>> be pursued?
>>> If the reccomendation is to pursue a custom pageFlowScopeProvider, my
>>> client (a government client) is happy to enter into a commercial
>>> arangement with a committer here. i.e. they will pay for a solution.
>>> Either to yourself of the Apache foundation etc. My code is available
>>> if it helps.
>>> Cheers,
>>> MarkB
>>> ********************************************************
>>> The information in this e-mail is intended for the named recipient 
>>> only.
>>> It may contain privileged and/or confidential information. If you are
>>> not the intended recipient, you must not disclose, copy, distribute,
>>> take any action or reliance on it. If you have received this e-mail in
>>> error, please notify the sender immediately and delete this e-mail.
>>> Warning: E-mail transmission cannot be guaranteed to be secure or
>>> error-free. The recipient should check this email and any attachments
>>> for the presence of viruses. The sender does not accept liability for
>>> any errors or omissions in the contents of this message.
>>> ********************************************************

View raw message