Author: ghjboss
Date: 2012-05-11 12:32:36 -0400 (Fri, 11 May 2012)
New Revision: 8709
Modified:
epp/portal/branches/EPP_5_2_0_GA_BZ819631/webui/portal/src/main/java/org/exoplatform/portal/application/localization/LocalizationFilter.java
Log:
commit fix for BZ819631
Modified:
epp/portal/branches/EPP_5_2_0_GA_BZ819631/webui/portal/src/main/java/org/exoplatform/portal/application/localization/LocalizationFilter.java
===================================================================
---
epp/portal/branches/EPP_5_2_0_GA_BZ819631/webui/portal/src/main/java/org/exoplatform/portal/application/localization/LocalizationFilter.java 2012-05-07
19:33:58 UTC (rev 8708)
+++
epp/portal/branches/EPP_5_2_0_GA_BZ819631/webui/portal/src/main/java/org/exoplatform/portal/application/localization/LocalizationFilter.java 2012-05-11
16:32:36 UTC (rev 8709)
@@ -26,6 +26,7 @@
import org.exoplatform.container.RootContainer;
import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.container.web.AbstractFilter;
import org.exoplatform.portal.Constants;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.services.log.ExoLogger;
@@ -79,7 +80,7 @@
*
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
-public class LocalizationFilter implements Filter
+public class LocalizationFilter extends AbstractFilter
{
private static Log log = ExoLogger.getLogger("portal:LocalizationFilter");
@@ -87,7 +88,8 @@
private Locale portalLocale = Locale.ENGLISH;
- public void init(FilterConfig filterConfig) throws ServletException
+ @Override
+ public void afterInit(FilterConfig filterConfig) throws ServletException
{
String locale = filterConfig.getInitParameter("PortalLocale");
locale = locale != null ? locale.trim() : null;
@@ -129,7 +131,7 @@
// Initialize currentLocale
- ExoContainer container = ExoContainerContext.getCurrentContainerIfPresent();
+ ExoContainer container = getContainer();
if (container == null)
{
// Nothing we can do, move on
@@ -137,9 +139,6 @@
return;
}
- if (container instanceof RootContainer)
- container = (ExoContainer)
container.getComponentInstance("portal");
-
LocaleConfigService localeConfigService = (LocaleConfigService)
container.getComponentInstanceOfType(LocaleConfigService.class);
LocalePolicy localePolicy = (LocalePolicy)
container.getComponentInstanceOfType(LocalePolicy.class);
Show replies by date