2 Replies Latest reply on Jun 3, 2008 10:21 AM by je.a.le

    Forcing locale

    jvence

      Is there anyway to force a specific locale to load when a user first enters the portal. Something like http://localhost:8080/portal?locale=fr would force the French locale to be used.

      Also, is there anyway to dynamically change the locale by setting some variable so that the user does not have to go in his profile to specify the locale . For example; the way this would work is that we would have an entry page with flags, when the user click on a specific country flag, the locale is set automatically for that user.

      Many thanks,

      Jean

        • 1. Re: Forcing locale
          je.a.le

          I'm pushing this "old" thread back on top because i'm having the same problem.

          I would like to offer users the posibility to choose language not only throw brower language setting (request.getLocale() ) but also throw an interface (js/jsp etc...)
          For my datas, I can walk around with session. The problem is jbossportal (window, menu, etc..).

          how could i inform jossportal to use a locale for a specific session (anomymous ) ???
          Is there a servlet/filter/even listener I could use ??? mbean ?

          thks

          • 2. Re: Forcing locale
            je.a.le

            I managed to inject/force a custorm local by adding a new mbean (ServerInterceptor) into JBossInterceptorStackFactory (jboss-service.xml)

            My problem now is i'm unable to retrive any session attribure passed from a servlet into the HttpSession. On the servlet side, no pb, can read attribute back.
            The only solution I found is to use PortalSession... with portlet. i strongly prefer servlet :-)

            I tried also from a jsp/scriptlet into portal-core without success.
            What I set into those servlets is valid, but cannot been read back from the interceptor.

            Any clue ???

            Doesn't look to be an issue but just in case, my jboss-service.xml changes :

            <mbean
             code="org.jboss.portal.core.aspects.server.ACLocaleInterceptor"
             name="portal:service=Interceptor,type=Server,name=ACLocale"
             xmbean-dd=""
             xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
             <xmbean/>
             </mbean>
            <mbean
             code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
             name="portal:service=InterceptorStackFactory,type=Server"
             xmbean-dd=""
             xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
             <xmbean/>
             <depends-list optional-attribute-name="InterceptorNames">
             <depends-list-element>portal:service=Interceptor,type=Server,name=SessionLock</depends-list-element>
             <depends-list-element>portal:service=Interceptor,type=Server,name=Transaction</depends-list-element>
             <depends-list-element>portal:service=Interceptor,type=Server,name=UserEvent</depends-list-element>
             <depends-list-element>portal:service=Interceptor,type=Server,name=SessionInvalidator</depends-list-element>
             <depends-list-element>portal:service=Interceptor,type=Server,name=User</depends-list-element>
             <depends-list-element>portal:service=Interceptor,type=Server,name=ACLocale</depends-list-element>
             <depends-list-element>portal:service=Interceptor,type=Server,name=Locale</depends-list-element>
             <depends-list-element>portal:service=Interceptor,type=Server,name=ContentType</depends-list-element>
             </depends-list>
             </mbean>
            


            THKS