You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/02/18 13:40:06 UTC

svn commit: r1569294 - /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java

Author: lofwyr
Date: Tue Feb 18 12:40:06 2014
New Revision: 1569294

URL: http://svn.apache.org/r1569294
Log:
TOBAGO-1228: Setting JSF 2.0 as default version for Tobago

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java?rev=1569294&r1=1569293&r2=1569294&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java Tue Feb 18 12:40:06 2014
@@ -32,7 +32,7 @@ import java.util.Map;
 
 public final class ClientPropertiesKey implements Serializable {
 
-  private static final String KEY_IN_REQUEST = ClientPropertiesKey.class.getName();
+  private static final String KEY_IN_FACES_CONTEXT = ClientPropertiesKey.class.getName();
   
   private final String contentType;
   private final Theme theme;
@@ -42,21 +42,19 @@ public final class ClientPropertiesKey i
   private final int hashCode;
 
   public static ClientPropertiesKey get(final FacesContext facesContext) {
-    // todo later: refactor when having JSF 2.0: using attributes of facesContext
-    final Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
-    ClientPropertiesKey key = (ClientPropertiesKey) requestMap.get(KEY_IN_REQUEST);
+    final Map<Object, Object> attributes = facesContext.getAttributes();
+    ClientPropertiesKey key = (ClientPropertiesKey) attributes.get(KEY_IN_FACES_CONTEXT);
     if (key == null) {
       final ClientProperties clientProperties = VariableResolverUtils.resolveClientProperties(facesContext);
       key = new ClientPropertiesKey(clientProperties, facesContext.getViewRoot());
-      requestMap.put(KEY_IN_REQUEST, key);
+      attributes.put(KEY_IN_FACES_CONTEXT, key);
     }
-
     return key;
   }
 
   public static void reset(final FacesContext facesContext) {
-    final Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
-    requestMap.remove(KEY_IN_REQUEST);
+    final Map<Object, Object> attributes = facesContext.getAttributes();
+    attributes.remove(KEY_IN_FACES_CONTEXT);
   }
   
   private ClientPropertiesKey(final ClientProperties clientProperties, final UIViewRoot viewRoot) {