You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ed...@apache.org on 2008/07/24 21:42:30 UTC

svn commit: r679513 - /portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultRequestAttributeService.java

Author: edalquist
Date: Thu Jul 24 12:42:30 2008
New Revision: 679513

URL: http://svn.apache.org/viewvc?rev=679513&view=rev
Log:
PLUTO-486 Caching the USER_INFO map in the request

Modified:
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultRequestAttributeService.java

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultRequestAttributeService.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultRequestAttributeService.java?rev=679513&r1=679512&r2=679513&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultRequestAttributeService.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultRequestAttributeService.java Thu Jul 24 12:42:30 2008
@@ -74,7 +74,13 @@
      */
     public Object getAttribute(PortletRequest portletRequest, HttpServletRequest httpServletRequest, PortletWindow portletWindow, String name) {
         if (PortletRequest.USER_INFO.equals(name)) {
-            return this.createUserInfoMap(portletRequest, portletWindow);
+            Map<String, String> userInfo = (Map<String, String>)httpServletRequest.getAttribute(PortletRequest.USER_INFO);
+            // Fix for PLUTO-486, cache the user_info map as a request attribute
+            if (userInfo == null) {
+                userInfo = this.createUserInfoMap(portletRequest, portletWindow);
+                httpServletRequest.setAttribute(PortletRequest.USER_INFO, userInfo);
+            }
+            return userInfo;
         }
         
         final String encodedName = this.encodeAttributeName(portletWindow, name);