portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1102798 - in /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl: LocalizationValveImpl.java SimplifiedLocalizationValveImpl.java
Date Fri, 13 May 2011 15:46:48 GMT
Author: ate
Date: Fri May 13 15:46:47 2011
New Revision: 1102798

URL: http://svn.apache.org/viewvc?rev=1102798&view=rev
Log:
JS2-1183: ensure CurrentLocale ThreadLocal reset after (request) usage

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/LocalizationValveImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/SimplifiedLocalizationValveImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/LocalizationValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/LocalizationValveImpl.java?rev=1102798&r1=1102797&r2=1102798&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/LocalizationValveImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/LocalizationValveImpl.java
Fri May 13 15:46:47 2011
@@ -167,8 +167,15 @@ public class LocalizationValveImpl exten
         request.getRequest().getSession().setAttribute(PortalReservedParameters.PREFERED_LOCALE_ATTRIBUTE,
locale);
         CurrentLocale.set(locale);
         // Pass control to the next Valve in the Pipeline
-        context.invokeNext(request);
-
+        try
+        {
+            context.invokeNext(request);
+        }
+        finally
+        {
+            // ensure clearing of ThreadLocal state after request
+            CurrentLocale.set(null);
+        }
     }
 
     public String toString()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/SimplifiedLocalizationValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/SimplifiedLocalizationValveImpl.java?rev=1102798&r1=1102797&r2=1102798&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/SimplifiedLocalizationValveImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/localization/impl/SimplifiedLocalizationValveImpl.java
Fri May 13 15:46:47 2011
@@ -119,8 +119,15 @@ public class SimplifiedLocalizationValve
         CurrentLocale.set(locale);
        
         // Pass control to the next Valve in the Pipeline
-        context.invokeNext(request);
-
+        try
+        {
+            context.invokeNext(request);
+        }
+        finally
+        {
+            // ensure clearing of ThreadLocal state after request
+            CurrentLocale.set(null);
+        }
     }
 
     public String toString()



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message