myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1569297 - /myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
Date Tue, 18 Feb 2014 12:41:01 GMT
Author: lofwyr
Date: Tue Feb 18 12:41:00 2014
New Revision: 1569297

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

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

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java?rev=1569297&r1=1569296&r2=1569297&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ClientPropertiesKey.java
Tue Feb 18 12:41:00 2014
@@ -32,8 +32,8 @@ 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;
   private final UserAgent userAgent;
@@ -42,23 +42,21 @@ 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)
{
     contentType = clientProperties.getContentType();
     theme = clientProperties.getTheme();



Mime
View raw message