Re: struts-menu & i18n - switching locale on user login

"Matt Raible" <[email protected]>
Newsgroups gmane.comp.java.struts-menu.user
Message-ID <[email protected]>
The only thing I can think of is Velocity is caching the menu's output
and therefore not switching the locale's for you.

Matt

On 4/24/06, Norbert Rieger <info.nrieger-S0/[email protected]> wrote:
> Hi,
>
> due to a little mistake this question was also posted under item "Multiple
> Menus", Ryan Keeling, 2006-04-21, sorry for that.
>
>
>
> I want to switch the "locale" based on user settings.
>
> I'm using struts and JSTL 1.2, switching locale works fine with:
>
>   // change struts' locale
>   session.setAttribute(org.apache.struts.Globals.LOCALE_KEY, newLocale);
>   // change JSTL's locale
>   Config.set(session, Config.FMT_LOCALE, newLocale) ;
>
> But menu titles won't switch, they appear always in the same language.
> What do I have to set / change ?
>
> Google found a "solution", using MenuDisplayer's locale attribute, but it
> won't work for me. Maybe I'm setting the attribute wrong.
> How do I have to set this attribute to read the JSTL/Struts locale ?
>
> Thanxs a lot for your help.
> Norbert
>
>
> Here's my menu-config.xml
>
> <MenuConfig>
>   <Displayers>
>     <Displayer   name="Velocity"
> type="net.sf.navigator.displayer.VelocityMenuDisplayer"/>
>   </Displayers>
>
>   <Menus>
>     <Menu name="Logout" title="menu.Logout.title" action="/Logout"/>
>     <Menu name="Admin" title="menu.Admin.title">
>         <Item name="T1" title="Admin 1"/>
>         <Item name="T2" title="Admin 2"/>
>         <Item name="T3" title="Admin 3"/>
>     </Menu>
>     <Menu name="Test" title="Test">
>         <Item name="T1" title="Item 1"/>
>         <Item name="T2" title="Item 2"/>
>         <Item name="T3" title="Item 3"/>
>     </Menu>
>   </Menus>
> </MenuConfig>
>
> and the menu.jsp, which is included via struts tiles:
>
> <%@ taglib uri="http://struts-menu.sf.net/tag" prefix="menu" %>
>
> <div id="menuDiv">
> <menu:useMenuDisplayer name="Velocity" config="/templates/tabs.html"
>      bundle="webapps.base.properties.menu">
>      <ul id="menuList">
>        <menu:displayMenu name="Test"/>
>        <menu:displayMenu name="Admin"/>
>        <menu:displayMenu name="Logout"/>
>      </ul>
> </menu:useMenuDisplayer>
> </div>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> struts-menu-user mailing list
> struts-menu-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/struts-menu-user
>


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.