Author: julien(a)jboss.com
Date: 2007-05-06 13:21:10 -0400 (Sun, 06 May 2007)
New Revision: 7201
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/server/LocaleInterceptor.java
Log:
- JBPORTAL-1380 : LocaleInterceptor does not build correctly the Locale from the user
favorite locale
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/server/LocaleInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/server/LocaleInterceptor.java 2007-05-06
16:33:54 UTC (rev 7200)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/server/LocaleInterceptor.java 2007-05-06
17:21:10 UTC (rev 7201)
@@ -23,6 +23,8 @@
package org.jboss.portal.core.aspects.server;
import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.i18n.LocaleFormat;
+import org.jboss.portal.common.util.ConversionException;
import org.jboss.portal.server.ServerInterceptor;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerRequest;
@@ -55,24 +57,25 @@
//
if (profile != null)
{
+ Locale locale = null;
Object lc = profile.get(User.INFO_USER_LOCALE);
- Locale locale = null;
if (lc instanceof Locale)
{
locale = (Locale)lc;
}
- else
+ else if (lc != null)
{
try
{
- locale = new Locale(lc.toString());
+ locale = LocaleFormat.DEFAULT.getLocale(lc.toString());
}
- catch (Exception e)
+ catch (ConversionException e)
{
//just to hide failure
}
}
+ //
if (locale != null)
{
locales.add(locale);