[ 
https://issues.apache.org/jira/browse/MYFACES-3117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025724#comment-13025724
 ] 

Jakob Korherr commented on MYFACES-3117:
----------------------------------------

You're right, that's a very big problem. However, only if you use server-side 
state-saving.

The first idea which popped into my mind was using a window-id (which we also 
requested for JSF 2.2, see [1]).

Your proposal seems even better to me, but we can't commit it directly in the 
way you are proposing since we should support the double submit scenarios too. 
Maybe we could remove it after the next but one view has been restored, meaning 
that you have three view states 1, 2, 3 and you remove 1 after you restored 3. 
Just an idea...

However, if we commit something that may cause any side effects from the 
current (== old) behavior (e.g. no double submit possible), we have to make it 
configurable. Otherwise the chance is high that we break a lot of existing 
applications...

[1] http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949

> Current server state saving implementation prevents multi-window usage
> ----------------------------------------------------------------------
>
>                 Key: MYFACES-3117
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3117
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.6-SNAPSHOT
>         Environment: myfaces core trunk
>            Reporter: Martin Kočí
>            Priority: Critical
>         Attachments: MYFACES-3117.patch
>
>
> Problem:
> open two tabs (or windows) in browser with view:
> <h:body>
>         <h:form id="formId">
>             <h:commandButton value="Click me 20x!" />
>         </h:form>
>  </h:body>
> then click the button on the first tab 20x or more -> then click the button 
> on the second tab -> you will get the most beloved ViewExpiredException.
> Reason:
> oam.SerializedViewCollection drops the saved state for 2. tab from map. 
> Suggestion:
> remove the successfully restored view state from map. This can be done, 
> because each SerializedViewKey is unique over *all requests* for one 
> HttpSession -  see 
> DefaultFaceletsStateManagementHelper.nextViewSequence(FacesContext). Because 
> each request has unique sequence number, we can the "just restored" one 
> remove from the map, because it can never come from  client again.
> Open question: the previous statement is true except the double submit 
> problem:       JAVASERVERFACES_SPEC_PUBLIC-559. In this case, server can 
> process same request (with the same sequence number) twice.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to