You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by vo...@apache.org on 2021/08/30 18:38:21 UTC

[myfaces] branch 2.3-next updated: Myfaces 4404: Log viewstate hash

This is an automated email from the ASF dual-hosted git repository.

volosied pushed a commit to branch 2.3-next
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/2.3-next by this push:
     new ef23852  Myfaces 4404: Log viewstate hash
ef23852 is described below

commit ef23852525eeab8dbfa05505a4319ef33f018401
Author: Volodymyr Siedlecki <vo...@gmail.com>
AuthorDate: Mon Aug 30 14:25:36 2021 -0400

    Myfaces 4404: Log viewstate hash
---
 .../java/org/apache/myfaces/application/viewstate/StateUtils.java  | 1 +
 .../apache/myfaces/renderkit/html/HtmlResponseStateManager.java    | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/impl/src/main/java/org/apache/myfaces/application/viewstate/StateUtils.java b/impl/src/main/java/org/apache/myfaces/application/viewstate/StateUtils.java
index 707e83b..3077a1e 100644
--- a/impl/src/main/java/org/apache/myfaces/application/viewstate/StateUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/application/viewstate/StateUtils.java
@@ -367,6 +367,7 @@ public final class StateUtils
             if (log.isLoggable(Level.FINE))
             {
                 log.fine("Processing state : " + string);
+                log.fine("Processing serialized viewstate string with hashCode : " + string.hashCode());
             }
 
             bytes = string.getBytes(ZIP_CHARSET);
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
index 45ac05f..f1584e8 100755
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
@@ -20,8 +20,10 @@ package org.apache.myfaces.renderkit.html;
 
 import java.io.IOException;
 import java.util.Map;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
+
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
 import javax.faces.lifecycle.ClientWindow;
@@ -113,6 +115,11 @@ public class HtmlResponseStateManager extends MyfacesResponseStateManager
         String serializedState = getStateCache(facesContext).getStateTokenProcessor(facesContext)
                 .encode(facesContext, savedState);
 
+        if (log.isLoggable(Level.FINE)) 
+        {
+             log.fine("Writing serialized viewstate string with hashCode : " + serializedState.hashCode());
+        } 
+
         responseWriter.startElement(HTML.INPUT_ELEM, null);
         responseWriter.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
         responseWriter.writeAttribute(HTML.NAME_ATTR, ResponseStateManager.VIEW_STATE_PARAM, null);