As for the question on views, if your view's state is saved on the client, then there is a component tree that the client stores, not the server, so that view is never reused on the server. The view is restored from the view that is posted back from the client to the server. With client state saving, you will not have problems with the user posting several times in different tabs of their browser. Note that client saving has its own limitations. For example, I cannot have a popup dialog talk to a main page using a post back, I'd have to do it through _javascript_. From playing around, I don't recommend server state saving in the session as there are too many problems that can be created by the user (back button, popup dialogs, etc.), the Seam conversations are much more flexible for that.
-Andrew
On 10/21/05, ir. ing. Jan Dockx <[EMAIL PROTECTED]> wrote:
That's the saving, but that's not what I mean :-).
1) Certainly with save state = server, there is only 1 uiview tree per
session per viewId=jsp page, right?
2) If so, what happens if 2 concurrent requests are executed for the
same session/viewId? The same tree is used? (You seem to imply a
different tree is created for each request, whose state is initialized
to the last saved state, which triggers questions about which of the
concurrent executions will finally save the state for the next batch).
3) Where is the code that handles this (if the answer to 1 and 2 is
"no").
I know there is some synchronization for this in RI somewhere (although
I did not completely work it through).
On 20 Oct 2005, at 13:45, Mathias Brökelmann wrote:
> It´s done in the implementation of the StateManager:
>
> JspStateManagerImpl.saveSerializedView(...)
> to save the component tree and the component state and
> JspStateManagerImpl.restoreView(...)
> to restore the component tree and the components state
>
> The state of the components is collected by
> UIComponent.processSaveState() and populated by
> UIComponent.processRestoreState() these methods traverses the
> component tree and call StateHolder.saveState() or
> StateHolder.restoreState() for each component.
>
> The StateHolder is responsible for collecting/populating the state and
> how the state is carried between the requests. JSF defines two default
> modes client and server side state saving. If client side is used the
> component tree and component state is written to the response in a way
> so that a request based on the response send this data back to the
> server. This is normally done by hidden input fields or if _javascript_
> is disabled by url params (which is limited of course).
>
> Server side state is simply stored in the session.
>
> 2005/10/20, ir. ing. Jan Dockx <[EMAIL PROTECTED]>:
>> I mean, which class, which method?
>>
>>
>> On 19 Oct 2005, at 19:14, ir. ing. Jan Dockx wrote:
>>
>>> Some things are unclear in that respect for me. If "Each request has
>>> its own component tree instantiated", how is view state information
>>> carried across request/response cycles then?
>>>
>>> Can you point me to the code in question? It's been difficult to
>>> find.
>>>
>>> On 19 Oct 2005, at 14:29, Mathias Brökelmann wrote:
>>>
>>>> Each request has its own component tree instantiated. So there
>>>> should
>>>> no problem with concurrency. If you use session or application
>>>> scoped
>>>> beans then you have to care for concurrency of course.
>>>>
>>>> 2005/10/19, ir. ing. Jan Dockx <[EMAIL PROTECTED]>:
>>>>> What happens if 2 concurrent requests for the same uiview are
>>>>> received
>>>>> in MyFaces? Are they serialized? Is a second component tree
>>>>> instantiated? Or are there indeed concurrency problems?
>>>>>
>>>>>
>>>>> Met vriendelijke groeten,
>>>>>
>>>>> Jan Dockx
>>>>>
>>>>> PeopleWare NV - Head Office
>>>>> Cdt.Weynsstraat 85
>>>>> B-2660 Hoboken
>>>>> Tel: +32 3 448.33.38
>>>>> Fax: +32 3 448.32.66
>>>>>
>>>>> PeopleWare NV - Branch Office Geel
>>>>> Kleinhoefstraat 5
>>>>> B-2440 Geel
>>>>> Tel: +32 14 57.00.90
>>>>> Fax: +32 14 58.13.25
>>>>>
>>>>> http://www.peopleware.be/
>>>>> http://www.mobileware.be/
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Mathias
>>>>
>>>>
>>> Met vriendelijke groeten,
>>>
>>> Jan Dockx
>>>
>>> PeopleWare NV - Head Office
>>> Cdt.Weynsstraat 85
>>> B-2660 Hoboken
>>> Tel: +32 3 448.33.38
>>> Fax: +32 3 448.32.66
>>>
>>> PeopleWare NV - Branch Office Geel
>>> Kleinhoefstraat 5
>>> B-2440 Geel
>>> Tel: +32 14 57.00.90
>>> Fax: +32 14 58.13.25
>>>
>>> http://www.peopleware.be/
>>> http://www.mobileware.be/
>>>
>> Met vriendelijke groeten,
>>
>> Jan Dockx
>>
>> PeopleWare NV - Head Office
>> Cdt.Weynsstraat 85
>> B-2660 Hoboken
>> Tel: +32 3 448.33.38
>> Fax: +32 3 448.32.66
>>
>> PeopleWare NV - Branch Office Geel
>> Kleinhoefstraat 5
>> B-2440 Geel
>> Tel: +32 14 57.00.90
>> Fax: +32 14 58.13.25
>>
>> http://www.peopleware.be/
>> http://www.mobileware.be/
>>
>>
>>
>
>
> --
> Mathias
>
>
Met vriendelijke groeten,
Jan Dockx
PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66
PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25
http://www.peopleware.be/
http://www.mobileware.be/

