Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D30B210880 for ; Thu, 31 Oct 2013 18:43:19 +0000 (UTC) Received: (qmail 52913 invoked by uid 500); 31 Oct 2013 18:43:19 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 52874 invoked by uid 500); 31 Oct 2013 18:43:19 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 52866 invoked by uid 99); 31 Oct 2013 18:43:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Oct 2013 18:43:19 +0000 Date: Thu, 31 Oct 2013 18:43:19 +0000 (UTC) From: "Dora Rajappan (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MYFACES-3804) Use the same key in server side state saving for ajax requests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MYFACES-3804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13810542#comment-13810542 ] Dora Rajappan commented on MYFACES-3804: ---------------------------------------- One good aspect of using the same key for ajax is that it will retain valid views in map than redundant ajax views. > Use the same key in server side state saving for ajax requests > -------------------------------------------------------------- > > Key: MYFACES-3804 > URL: https://issues.apache.org/jira/browse/MYFACES-3804 > Project: MyFaces Core > Issue Type: Improvement > Components: JSR-344 > Reporter: Leonardo Uribe > > The current code for server side state saving creates one key per request to store the view state. This is ok, but it is not necessary for ajax requests. > The reason why is not necessary is because you can never go back to a page when using ajax. If you are on page A and the current request is an ajax request and it returns to the same page and the view is the same that the one that has been restored, the key or the token sent does not need to change, what changes is the internal state of the view. From the client side the page is the same. We can take advantage of this fact and just update the state stored in SerializedViewCollection for the view. > The challenge here is detect when this strategy is applicable. For example, what happen if there is an ajax redirect? It looks is a good idea for implement in 2.2, because it avoids to store unnecessary information into session and optimize the use of each view slot. -- This message was sent by Atlassian JIRA (v6.1#6144)