myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject cvs commit: incubator-myfaces/src/jsfapi/javax/faces/application StateManager.java
Date Tue, 18 Jan 2005 07:03:16 GMT
matzew      2005/01/17 23:03:16

  Modified:    src/myfaces/org/apache/myfaces/application/jsp
                        JspStateManagerImpl.java
               src/jsfapi/javax/faces/application StateManager.java
  Log:
  added patch form Sean Schofield to solve state saving issue on server side. (MyFaces-81)
  
  Revision  Changes    Path
  1.22      +16 -16    incubator-myfaces/src/myfaces/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
  
  Index: JspStateManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/myfaces/org/apache/myfaces/application/jsp/JspStateManagerImpl.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JspStateManagerImpl.java	13 Oct 2004 11:50:59 -0000	1.21
  +++ JspStateManagerImpl.java	18 Jan 2005 07:03:15 -0000	1.22
  @@ -32,6 +32,7 @@
   import javax.faces.render.ResponseStateManager;
   import java.io.IOException;
   
  +
   /**
    * Default StateManager implementation.
    * @author Thomas Spiegl (latest modification by $Author$)
  @@ -41,6 +42,9 @@
    * @author Manfred Geiler
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.22  2005/01/18 07:03:15  matzew
  + * added patch form Sean Schofield to solve state saving issue on server side. (MyFaces-81)
  + *
    * Revision 1.21  2004/10/13 11:50:59  matze
    * renamed packages to org.apache
    *
  @@ -324,25 +328,21 @@
       {
           // TODO: What, if user has more than one browser window open on the same page?!
           // only the state of the latest accessed window will be stored at the moment
  -        externalContext.getSessionMap().put(SERIALIZED_VIEW_SESSION_ATTR + "-" + viewId,
  -                                            new Object[] {viewId, serializedView});
  +        Object sv[] = new Object[] {serializedView.getStructure(), serializedView.getState()};
  +        externalContext.getSessionMap().put(SERIALIZED_VIEW_SESSION_ATTR + "-" + viewId,
sv);
       }
       
       protected SerializedView getSerializedViewFromServletSession(ExternalContext externalContext,
                                                                    String viewId)
       {
  -        Object[] ar = (Object[])externalContext.getSessionMap().get(SERIALIZED_VIEW_SESSION_ATTR
+ "-" + viewId);
  -        if (ar == null) return null;    // no state information in session
  -        String savedViewId = (String)ar[0];
  -        if (viewId == null || viewId.equals(savedViewId))
  +        String key = SERIALIZED_VIEW_SESSION_ATTR + "-" + viewId;
  +        if (externalContext.getSessionMap().get(key) == null)
           {
  -            return (SerializedView)ar[1];
  -        }
  -        else
  -        {
  -            //saved state applies to different viewId
  -            return null;
  +            return null; // no state information in session
           }
  +
  +        Object sv[] = (Object[])externalContext.getSessionMap().get(key);
  +        return new SerializedView(sv[0], sv[1]);
       }
   
       protected void removeSerializedViewFromServletSession(ExternalContext externalContext,
String viewId)
  
  
  
  1.7       +3 -3      incubator-myfaces/src/jsfapi/javax/faces/application/StateManager.java
  
  Index: StateManager.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/jsfapi/javax/faces/application/StateManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StateManager.java	15 Nov 2004 10:31:52 -0000	1.6
  +++ StateManager.java	18 Jan 2005 07:03:16 -0000	1.7
  @@ -77,7 +77,7 @@
       }
   
   
  -    public class SerializedView implements Serializable
  +    public class SerializedView
       {
           private Object _structure;
           private Object _state;
  
  
  

Mime
View raw message