myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gcrawf...@apache.org
Subject svn commit: r953906 - in /myfaces/trinidad/branches/2.0.0.3.1-branch: trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
Date Fri, 11 Jun 2010 23:48:31 GMT
Author: gcrawford
Date: Fri Jun 11 23:48:31 2010
New Revision: 953906

URL: http://svn.apache.org/viewvc?rev=953906&view=rev
Log:
TRINIDAD-1829 - create a public api for zipping the page state

The current name of the param is
org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE

The proposed name of the param is
org.apache.myfaces.trinidad.COMPRESS_VIEW_STATE 

Modified:
    myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
    myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java

Modified: myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts?rev=953906&r1=953905&r2=953906&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
(original)
+++ myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
Fri Jun 11 23:48:31 2010
@@ -454,7 +454,7 @@
 <resource key="COMPARETO_TYPE_MISMATCH">The type for "{0}" prevents it from being compared
to "{1}".</resource>
 
 <!-- ZIP_STATE_FAILED -->
-<resource key="ZIP_STATE_FAILED">Failed to zip the page state.</resource>
+<resource key="ZIP_STATE_FAILED">Failed to zip the page state. The state must be serializable
to be zipped, so a common reason the page state fails to zip is that the page state is not
serializable.  You can turn off zipping by setting org.apache.myfaces.trinidad.COMPRESS_VIEW_STATE
to false. See the doc about system property org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION
for how to test various aspects of serialization.</resource>
 
 <!-- UNZIP_STATE_FAILED -->
 <resource key="UNZIP_STATE_FAILED">Failed to unzip the page state.</resource>

Modified: myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java?rev=953906&r1=953905&r2=953906&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
(original)
+++ myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
Fri Jun 11 23:48:31 2010
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -69,12 +69,12 @@ import org.apache.myfaces.trinidadintern
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/application/StateManagerImpl.java#2
$) $Date: 18-nov-2005.16:12:04 $
  */
 public class StateManagerImpl extends StateManagerWrapper
-{  
-  // TODO this should be removed, see comments in restoreView where this constant is used

+{
+  // TODO this should be removed, see comments in restoreView where this constant is used
   // on why this is needed
   public static final String RESPONSE_STATE_MANAGER_STATE_KEY =
-    "org.apache.myfaces.trinidadinternal.application.StateManagerImp.RESPONSE_STATE_MANAGER_STATE";
 
-  
+    "org.apache.myfaces.trinidadinternal.application.StateManagerImp.RESPONSE_STATE_MANAGER_STATE";
+
   static public final String CACHE_VIEW_ROOT_INIT_PARAM =
     "org.apache.myfaces.trinidad.CACHE_VIEW_ROOT";
 
@@ -94,14 +94,14 @@ public class StateManagerImpl extends St
    */
   static public final String CLIENT_STATE_MAX_TOKENS_PARAM_NAME =
     "org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKENS";
- 
+
   /**
    * Servlet context initialization parameter used by
    * StateManagerImpl to decide whether to zip state.
    * Valid values are true and false
    */
   static public final String COMPRESS_VIEW_STATE_PARAM_NAME =
-    "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE";
+    "org.apache.myfaces.trinidad.COMPRESS_VIEW_STATE";
 
   /**
    * Value indicating that only a simple token will be stored
@@ -120,7 +120,7 @@ public class StateManagerImpl extends St
   {
     _delegate = delegate;
   }
-  
+
   @Override
   public StateManager getWrapped()
   {
@@ -131,7 +131,7 @@ public class StateManagerImpl extends St
   public String getViewState(FacesContext context)
   {
     Object state = saveView(context);
-    
+
     if (state != null)
     {
       return context.getRenderKit().getResponseStateManager().getViewState(context,state);
@@ -148,31 +148,31 @@ public class StateManagerImpl extends St
   public Object saveView(FacesContext context)
   {
     assert(context != null);
-    
+
     // see if a view has been saved on the request
     Object viewState = _getCachedViewState(context);
-    
+
     if (viewState != null)
-    {    
+    {
       // TODO gcrawfor
       //        when is this not null, meaning when is saveView being called multiple times
       //        per request?
       return viewState;
     }
-    
+
     // if the root is transient don't state save
     UIViewRoot viewRoot = context.getViewRoot();
-    
-    if (viewRoot.isTransient()) 
+
+    if (viewRoot.isTransient())
     {
       return null;
     }
-    
+
     String viewId = context.getViewRoot().getViewId();
     StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
-    
-    if (sms != null) 
-    {      
+
+    if (sms != null)
+    {
       viewState = sms.saveView(context);
     }
     else
@@ -190,8 +190,8 @@ public class StateManagerImpl extends St
     {
       viewState = _saveStateToCache(context, viewState, viewRoot);
     }
-    
-    _saveCachedViewState(context, viewState);   
+
+    _saveCachedViewState(context, viewState);
     return viewState;
   }
 
@@ -207,7 +207,7 @@ public class StateManagerImpl extends St
     Object state = component.processSaveState(context);
     return new PageState(context, new Object[]{structure, state}, null);
   }
-  
+
   /**
    * Take an object created by saveComponentTree()
    * and instantiate it as a UIComponent.
@@ -226,7 +226,7 @@ public class StateManagerImpl extends St
         "INVALID_SAVED_STATE_OBJECT"));
 
     PageState viewState = (PageState) savedState;
-    
+
     Object[] stateArray = (Object[])viewState.getViewState();
     Object structure = stateArray[0];
     Object state = stateArray[1];
@@ -273,7 +273,7 @@ public class StateManagerImpl extends St
     {
       return root; // bug 4712492
     }
-    
+
     Object[] stateArray = (Object[])viewState.getViewState();
     Object structure = stateArray[0];
     Object state = stateArray[1];
@@ -285,7 +285,7 @@ public class StateManagerImpl extends St
       root.processRestoreState(context, state);
 
     return root;
-  }  
+  }
 
 
 
@@ -301,10 +301,10 @@ public class StateManagerImpl extends St
     Map<String, Object> sessionMap = extContext.getSessionMap();
 
     RequestContext trinContext = RequestContext.getCurrentInstance();
-    
+
     // get per window view cache key with "." separator suffix to separate the SubKeyMap
keys
     String subkey = _getViewCacheKey(extContext, trinContext, _SUBKEY_SEPARATOR);
-    
+
     Map<String, PageState> stateMap = new SubKeyMap<PageState>(sessionMap, subkey);
 
     // Sadly, we can't save just a SerializedView, because we should
@@ -331,7 +331,7 @@ public class StateManagerImpl extends St
 
       sessionMap.put(activePageStateKey, pageState);
     }
-    
+
     String requestToken = _getRequestTokenForResponse(context);
     // If we have a cached token that we want to reuse,
     // and that token hasn't disappeared from the cache already
@@ -358,16 +358,16 @@ public class StateManagerImpl extends St
                                 stateMap,
                                 pinnedToken);
     }
-    
+
 
     assert(token != null);
-    
+
     // And store the token for this request
     extContext.getRequestMap().put(_REQUEST_STATE_TOKEN_KEY, token);
 
     // Create a "tokenView" which abuses state to store
     // our token only
-    return new Object[]{token, null};    
+    return new Object[]{token, null};
   }
 
   /**
@@ -381,9 +381,9 @@ public class StateManagerImpl extends St
   {
     context.getExternalContext().getRequestMap().put(
             _PINNED_STATE_TOKEN_KEY, stateToken);
-    
+
   }
-  
+
   /**
    * @return the state token for the current request
    */
@@ -392,24 +392,24 @@ public class StateManagerImpl extends St
     return (String) context.getExternalContext().getRequestMap().get(
             _REQUEST_STATE_TOKEN_KEY);
   }
-  
-  
+
+
   /**
    * Mark the the incoming request token should be used for the response
    */
   @SuppressWarnings("unchecked")
   static public void reuseRequestTokenForResponse(ExternalContext ec)
   {
-    ec.getRequestMap().put(_REUSE_REQUEST_TOKEN_FOR_RESPONSE_KEY, Boolean.TRUE);    
+    ec.getRequestMap().put(_REUSE_REQUEST_TOKEN_FOR_RESPONSE_KEY, Boolean.TRUE);
   }
-  
+
   /**
    * Clears the flag indicating that the old request token should be used for the response.
    */
   @SuppressWarnings("unchecked")
   static public void clearReuseRequestTokenForResponse(ExternalContext ec)
   {
-    ec.getRequestMap().remove(_REUSE_REQUEST_TOKEN_FOR_RESPONSE_KEY);    
+    ec.getRequestMap().remove(_REUSE_REQUEST_TOKEN_FOR_RESPONSE_KEY);
   }
 
   /**
@@ -452,10 +452,10 @@ public class StateManagerImpl extends St
                                 String renderKitId)
   {
     final ExternalContext extContext = context.getExternalContext();
-    
-    // If we're being asked to execute a "return" event from, say, a dialog, always 
+
+    // If we're being asked to execute a "return" event from, say, a dialog, always
     // restore the "launch view", which was set over in the TrinidadFilter.
-    
+
     Map<String, Object> reqMap = extContext.getRequestMap();
     UIViewRoot launchView = (UIViewRoot)
                             reqMap.remove(RequestContextImpl.LAUNCH_VIEW);
@@ -464,7 +464,7 @@ public class StateManagerImpl extends St
       TrinidadPhaseListener.markPostback(context);
       return launchView;
     }
-          
+
     final Object structure;
     final Object state;
 
@@ -472,7 +472,7 @@ public class StateManagerImpl extends St
 
     if (_saveAsToken(context))
     {
-      // we saved the token in the structure portion of the state, so retrieve the 
+      // we saved the token in the structure portion of the state, so retrieve the
       // structure portion of the state to get the token.
       Object token = rsm.getTreeStructureToRestore(context, viewId);
       if (token == null)
@@ -489,7 +489,7 @@ public class StateManagerImpl extends St
       String subkey = _getViewCacheKey(extContext,
                                        RequestContext.getCurrentInstance(),
                                        _SUBKEY_SEPARATOR);
-      
+
       Map<String, PageState> stateMap = new SubKeyMap<PageState>(
                        extContext.getSessionMap(),
                        subkey);
@@ -525,14 +525,14 @@ public class StateManagerImpl extends St
       }
 
       StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
-      
-      if (sms!= null) 
+
+      if (sms!= null)
       {
         // TODO This is a hack because stateManagementStrategy doesn't take
         // a state object as a param, instead it always asks the responseStateManager
         // for the state, so push the state onto the request where the CoreResponseStateManager
         // can return it. We will file a bug agains JSF 2.0 asking that the
-        // stateManagementStrategy deprecate the current restoreView method in favor of 
+        // stateManagementStrategy deprecate the current restoreView method in favor of
         // a restoreView method that takes state
         try
         {
@@ -543,11 +543,11 @@ public class StateManagerImpl extends St
         {
           extContext.getRequestMap().remove(RESPONSE_STATE_MANAGER_STATE_KEY);
         }
-        
+
         return root;
-      } 
+      }
       else
-      {        
+      {
         Object[] stateArray = (Object[])viewState.getViewState();
         structure = stateArray[0];
         state = stateArray[1];
@@ -557,12 +557,12 @@ public class StateManagerImpl extends St
     {
 
       StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
-      
-      if (sms!= null) 
+
+      if (sms!= null)
       {
         return sms.restoreView(context, viewId, renderKitId);
-      } 
-      
+      }
+
       structure = rsm.getTreeStructureToRestore(context, viewId);
       state = rsm.getComponentStateToRestore(context);
     }
@@ -598,7 +598,7 @@ public class StateManagerImpl extends St
         ((Structure) structure).createComponent();
 
         if (state != null)
-          root.processRestoreState(context, state);          
+          root.processRestoreState(context, state);
 
         _LOG.finer("Restored state for view \"{0}\"", viewId);
         return root;
@@ -616,7 +616,7 @@ public class StateManagerImpl extends St
         _LOG.severe(iae);
       }
     }
-    
+
     return null;
   }
 
@@ -624,12 +624,12 @@ public class StateManagerImpl extends St
    * The given parameter (<code>perViewStateSaving</code>) indicates
    * if we need to enable client- OR server-side state-saving
    * for the current VIEW.
-   * 
+   *
    * <p>
    * <b>This is an internal method, that is ONLY called by the
    * Trinidad Document</b>
    * </p>
-   * 
+   *
    * @param perViewStateSaving <code>default</code>, <code>server</code>
or <code>client</code> for stateSaving
    */
   public void setPerViewStateSaving(String perViewStateSaving)
@@ -680,7 +680,7 @@ public class StateManagerImpl extends St
   private TokenCache _getViewCache(FacesContext context)
   {
     ExternalContext extContext = context.getExternalContext();
-    
+
     return TokenCache.getTokenCacheFromSession(context,
                                                _getViewCacheKey(extContext,
                                                                 RequestContext.getCurrentInstance(),
@@ -689,7 +689,7 @@ public class StateManagerImpl extends St
                                                _getCacheSize(extContext));
   }
 
-  
+
 
   /**
    * Returns a key suitable for finding the per-window active page state key
@@ -703,7 +703,7 @@ public class StateManagerImpl extends St
   {
     return _getPerWindowCacheKey(extContext, trinContext, _ACTIVE_PAGE_STATE_SESSION_KEY,
null);
   }
-  
+
   /**
    * Returns a key suitable for finding the per-window cache key
    * @param extContext
@@ -718,7 +718,7 @@ public class StateManagerImpl extends St
   {
     return _getPerWindowCacheKey(extContext, trinContext, _VIEW_CACHE_KEY, suffix);
   }
-  
+
   /**
    * Returns a key of the form <prefix>.<windowid><suffix> if a window
and a suffix are available
    *                           <prefix>.<window> if just a window is available
@@ -736,18 +736,18 @@ public class StateManagerImpl extends St
     Character suffix)
   {
     Window currWindow = trinContext.getWindowManager().getCurrentWindow(eContext);
-    
+
     // if we have a current window or a suffix, we need a StringBuilder to calculate the
cache key
     if ((currWindow != null) || (suffix != null))
     {
       // get the window id and the extra size neeeded to store it and its separator
       String windowId;
       int windowPartSize;
-    
+
       if (currWindow != null)
       {
         windowId = currWindow.getId();
-        
+
         // add 1 for separator
         windowPartSize = windowId.length() + 1;
       }
@@ -756,28 +756,28 @@ public class StateManagerImpl extends St
         windowId = null;
         windowPartSize = 0;
       }
-      
+
       int builderSize =  prefix.length() + windowPartSize;
-      
+
       // add extra space for the suffix Character
       if (suffix != null)
         builderSize += 1;
-      
+
       // add the constant part to the StringBuilder
       StringBuilder keyBuilder = new StringBuilder(builderSize);
       keyBuilder.append(prefix);
-      
+
       // add the windowId and its separator
       if (currWindow != null)
       {
         keyBuilder.append('.');
         keyBuilder.append(windowId);
       }
-      
+
       // add the suffix if any
       if (suffix != null)
         keyBuilder.append(suffix);
-      
+
       return keyBuilder.toString();
     }
     else
@@ -823,7 +823,7 @@ public class StateManagerImpl extends St
 
     ExternalContext external = context.getExternalContext();
     Object stateSavingMethod =
-      external.getInitParameterMap().get(StateManager.STATE_SAVING_METHOD_PARAM_NAME);  
 
+      external.getInitParameterMap().get(StateManager.STATE_SAVING_METHOD_PARAM_NAME);
 
     // on "SERVER" state-saving we return TRUE, since we want send down a token string.
     if ((stateSavingMethod == null) ||
@@ -842,7 +842,7 @@ public class StateManagerImpl extends St
       return false;
     }
 
-    // if the user has used the <document> 'stateSaving' attribute to specify 
+    // if the user has used the <document> 'stateSaving' attribute to specify
     // client, we force the state mananger (see above) to render the entire
     // state on the client. The indicator is stashed on the FacesContext and
     // is therefore NOT visible during "restoreView" phase. So if we reach this point
@@ -884,7 +884,7 @@ public class StateManagerImpl extends St
 
     return _DEFAULT_CACHE_SIZE;
   }
-  
+
 
   private boolean _useViewRootCache(FacesContext context)
   {
@@ -903,7 +903,7 @@ public class StateManagerImpl extends St
 
   private boolean _needStructure(FacesContext context)
   {
-    // TODO - partial state saving is handled by facelets in JSF 2.0, 
+    // TODO - partial state saving is handled by facelets in JSF 2.0,
     //        remove this method and anything that depends on it?
     return true;
   }
@@ -942,18 +942,18 @@ public class StateManagerImpl extends St
       // Nope, guess it's a facet
       // 2006-08-02: -= Simon Lessard
       //             Not 1.5 structure and inefficient loop
-      //             values() is more efficient as you don't have 
+      //             values() is more efficient as you don't have
       //             to do a second lookup for the value.
       Map<String, UIComponent> facets = parent.getFacets();
-      for(Iterator<UIComponent> facetIter = facets.values().iterator(); 
+      for(Iterator<UIComponent> facetIter = facets.values().iterator();
           facetIter.hasNext();)
       {
         if(facetIter.next() == kid)
         {
           facetIter.remove();
           // FIXME: -= Simon Lessard
-          //        Is that continue need to labeled to go all the way up to 
-          //        the first while? Currently it won't cause any problem, but 
+          //        Is that continue need to labeled to go all the way up to
+          //        the first while? Currently it won't cause any problem, but
           //        it's a performance loss.
           continue;
         }
@@ -1000,15 +1000,15 @@ public class StateManagerImpl extends St
     context.getExternalContext().getRequestMap().put(_CACHED_VIEW_STATE,
                                                      state);
   }
-  
+
   private StateManagementStrategy _getStateManagementStrategy(FacesContext context, String
viewId)
   {
     ViewDeclarationLanguage vdl =  context.getApplication().getViewHandler().
                                                     getViewDeclarationLanguage(context, viewId);
-    if (vdl != null) 
+    if (vdl != null)
     {
       return vdl.getStateManagementStrategy(context, viewId);
-    }    
+    }
     else
     {
       return null;
@@ -1021,11 +1021,11 @@ public class StateManagerImpl extends St
     {
       if (viewRoot == null)
         throw new NullPointerException();
-      
+
       _viewRoot = viewRoot;
       _viewRootState = viewRoot.saveState(context);
     }
-    
+
     public UIViewRoot getViewRoot()
     {
       return _viewRoot;
@@ -1035,7 +1035,7 @@ public class StateManagerImpl extends St
     {
       return _viewRootState;
     }
-   
+
     private final UIViewRoot _viewRoot;
     private final Object _viewRootState;
   }
@@ -1045,14 +1045,14 @@ public class StateManagerImpl extends St
     private static final long serialVersionUID = 1L;
 
     private Object _viewState;
-    
+
     // use transient since UIViewRoots are not Serializable.
     private transient ViewRootState _cachedState;
 
     public PageState(FacesContext fc, Object viewState, UIViewRoot root)
     {
       _viewState = viewState;
-     
+
       boolean zipState = _zipState(fc);
 
       if (zipState || StateUtils.checkComponentTreeStateSerialization(fc))
@@ -1073,12 +1073,12 @@ public class StateManagerImpl extends St
             new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(viewState);
           }
           catch (IOException e)
-          {          
+          {
             throw new RuntimeException(_LOG.getMessage("COMPONENT_TREE_SERIALIZATION_FAILED"),
e);
           }
         }
       }
-                  
+
       // we need this state, as we are going to recreate the UIViewRoot later. see
       // the popRoot() method:
       _cachedState = (root != null)
@@ -1092,7 +1092,7 @@ public class StateManagerImpl extends St
       {
         return _unzipBytes((byte[])_viewState);
       }
-      
+
       return _viewState;
     }
 
@@ -1103,7 +1103,7 @@ public class StateManagerImpl extends St
         _cachedState = null;
       }
     }
-    
+
     @SuppressWarnings("unchecked")
     public UIViewRoot popRoot(FacesContext fc)
     {
@@ -1124,7 +1124,7 @@ public class StateManagerImpl extends St
           _cachedState = null;
         }
       }
-      
+
       if (root != null)
       {
         // If an error happens during updateModel, JSF 1.1 does not
@@ -1133,11 +1133,11 @@ public class StateManagerImpl extends St
         // so to clear the events, we create a new UIViewRoot.
         // must get the UIViewRoot from the application so that
         // we pick up any custom ViewRoot defined in faces-config.xml:
-        UIViewRoot newRoot = (UIViewRoot) 
+        UIViewRoot newRoot = (UIViewRoot)
           fc.getApplication().createComponent(UIViewRoot.COMPONENT_TYPE);
-        
+
         //This code handles automatic namespacing in a JSR-301 environment
-        if(ExternalContextUtils.isPortlet(fc.getExternalContext())) 
+        if(ExternalContextUtils.isPortlet(fc.getExternalContext()))
         {
           //IMPORTANT: To avoid introducing a runtime dependency on the bridge,
           //this method should only be executed when we have a portlet
@@ -1148,7 +1148,7 @@ public class StateManagerImpl extends St
           newRoot = PortletUtils.getPortletViewRoot(newRoot);
         }
 
-        
+
         // must call restoreState so that we setup attributes, listeners,
         // uniqueIds, etc ...
         newRoot.restoreState(fc, viewRootState);
@@ -1164,15 +1164,15 @@ public class StateManagerImpl extends St
         newRoot.getChildren().addAll(temp);
         return newRoot;
       }
-      
+
       return null;
-    }    
-    
+    }
+
 
     private boolean _zipState(FacesContext fc)
     {
       // default is false
-      Object zipStateObject = 
+      Object zipStateObject =
                            fc.getExternalContext().getInitParameter(COMPRESS_VIEW_STATE_PARAM_NAME);
 
       if (zipStateObject == null)
@@ -1186,23 +1186,23 @@ public class StateManagerImpl extends St
       Inflater decompressor = null;
       ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
       Map<String,Object> sessionMap  = externalContext.getSessionMap();
-        
+
       try
       {
         //Get inflater from session cope
-        TransientHolder<Inflater> th = 
+        TransientHolder<Inflater> th =
                               (TransientHolder<Inflater>)sessionMap.remove("PAGE_STATE_INFLATER");
-        
+
         if (th != null)
         {
           decompressor = th.getValue();
         }
-        
-        if(decompressor == null) 
+
+        if(decompressor == null)
         {
           decompressor = new Inflater();
         }
-        
+
         decompressor.setInput(zippedBytes);
         ByteArrayOutputStream bos = new ByteArrayOutputStream(zippedBytes.length);
         byte[] buf = new byte[zippedBytes.length*5];
@@ -1216,7 +1216,7 @@ public class StateManagerImpl extends St
           }
           catch (DataFormatException e)
           {
-            throw new RuntimeException(_LOG.getMessage("UNZIP_STATE_FAILED"), e); 
+            throw new RuntimeException(_LOG.getMessage("UNZIP_STATE_FAILED"), e);
           }
         }
 
@@ -1234,7 +1234,7 @@ public class StateManagerImpl extends St
       {
         throw new RuntimeException(_LOG.getMessage("UNZIP_STATE_FAILED"), ioe);
       }
-      finally 
+      finally
       {
         //Reset and put back
         if(decompressor != null)
@@ -1251,27 +1251,27 @@ public class StateManagerImpl extends St
       Deflater compresser = null;
       ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
       Map<String,Object> sessionMap  = externalContext.getSessionMap();
-      
+
       try
       {
         //Get deflater from session cope
-        TransientHolder<Deflater> th = 
+        TransientHolder<Deflater> th =
                               (TransientHolder<Deflater>)sessionMap.remove("PAGE_STATE_DEFLATER");
-        
+
         if (th != null)
         {
           compresser = th.getValue();
         }
-        
-        if(compresser == null) 
+
+        if(compresser == null)
         {
           compresser = new Deflater(Deflater.BEST_SPEED);
         }
-        
+
         //Serialize state
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
-        
+
         oos.writeObject(state);
         oos.flush();
         oos.close();
@@ -1296,7 +1296,7 @@ public class StateManagerImpl extends St
       {
         throw new RuntimeException(_LOG.getMessage("ZIP_STATE_FAILED"), e);
       }
-      finally 
+      finally
       {
         //Reset and put back
         if(compresser != null)
@@ -1310,7 +1310,7 @@ public class StateManagerImpl extends St
   }
 
   /**
-   * Static ENUM to capture the values of the <document>'s 
+   * Static ENUM to capture the values of the <document>'s
    * 'stateSaving' attribute
    */
   static private enum StateSaving
@@ -1332,15 +1332,15 @@ public class StateManagerImpl extends St
   private       Boolean      _useViewRootCache;
 
   private static final Character _SUBKEY_SEPARATOR = new Character('.');
-  
+
   private static final int _DEFAULT_CACHE_SIZE = 15;
-  
+
   // base key used to identify the view cache.  The window name, if any, is appended to this
   private static final String _VIEW_CACHE_KEY =
     "org.apache.myfaces.trinidadinternal.application.VIEW_CACHE";
 
   // key to stash the per_page_state_saving during rendering
-  private static final String _PER_PAGE_STATE_SAVING = 
+  private static final String _PER_PAGE_STATE_SAVING =
     "org.apache.myfaces.trinidadimpl.PER_PAGE_STATE_SAVING";
 
   private static final String _CACHED_VIEW_STATE=
@@ -1357,7 +1357,7 @@ public class StateManagerImpl extends St
 
   // key for saving the PageState for the last accessed view in this Session
   private static final String _ACTIVE_PAGE_STATE_SESSION_KEY =
-              "org.apache.myfaces.trinidadinternal.application.StateManagerImp.ACTIVE_PAGE_STATE";
 
+              "org.apache.myfaces.trinidadinternal.application.StateManagerImp.ACTIVE_PAGE_STATE";
 
   private static final long serialVersionUID = 1L;
 



Mime
View raw message