incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r454561 - /incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java
Date Mon, 09 Oct 2006 23:59:41 GMT
Author: awiner
Date: Mon Oct  9 16:59:41 2006
New Revision: 454561

URL: http://svn.apache.org/viewvc?view=rev&rev=454561
Log:
Implement isPostback();  and change the name of the state field to ResponseStateManager.VIEW_STATE_PARAM

Modified:
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java

Modified: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java?view=diff&rev=454561&r1=454560&r2=454561
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java
(original)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java
Mon Oct  9 16:59:41 2006
@@ -67,7 +67,8 @@
     ResponseWriter rw = context.getResponseWriter();
     rw.startElement("input", null);
     rw.writeAttribute("type", "hidden", null);
-    rw.writeAttribute("name", _STATE_FIELD_NAME, null);
+    rw.writeAttribute("name", VIEW_STATE_PARAM, null);
+    rw.writeAttribute("id", VIEW_STATE_PARAM, null);
 
     String s = encodeSerializedViewAsString(serializedView);
     rw.writeAttribute("value", s, null);
@@ -75,6 +76,16 @@
     rw.endElement("input");
   }
 
+  @Override
+  /**
+   * A request is a postback if it contains the state parameter.
+   */
+  public boolean isPostback(FacesContext context)
+  {
+    Map requestParams = context.getExternalContext().getRequestParameterMap();
+    return requestParams.containsKey(VIEW_STATE_PARAM);
+  }
+
 
   protected String encodeSerializedViewAsString(
     StateManager.SerializedView serializedView) throws IOException
@@ -143,7 +154,7 @@
       Map<String, String> requestParamMap =
          context.getExternalContext().getRequestParameterMap();
 
-      String stateString = requestParamMap.get(_STATE_FIELD_NAME);
+      String stateString = requestParamMap.get(VIEW_STATE_PARAM);
       if (stateString == null)
         return null;
 
@@ -193,8 +204,6 @@
 
     return view;
   }
-
-  static private final String _STATE_FIELD_NAME = "org.apache.myfaces.trinidad.faces.STATE";
 
 
   /* Test code for dumping out the page's state



Mime
View raw message