Internationalization of menu items using Struts-menu with struts 2
Tiago Farias <[email protected]> Wed, 16 Feb 2011 13:27:58 -0300
| Newsgroups | gmane.comp.java.struts-menu.user |
|---|---|
| Message-ID | <[email protected]> |
--===============3186152220487038909==
Content-Type: multipart/alternative; boundary=001636c9247593d4d0049c68c36c
--001636c9247593d4d0049c68c36c
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hello, I'm trying to make a custom menu for a web app and it all worked jus=
t
fine, but now I need to internationalize it using a properties file. This
properties file already exists and the whole app uses it. My menu-config.xm=
l
is this:
<Displayers>
<Displayer name=3D"Velocity"
type=3D"net.sf.navigator.displayer.VelocityMenuDisplayer"/>
</Displayers>
<Menus>
<!-- <Menu name=3D"ecfMenu" title=3D"ECFs" location=3D"?Contact">
<Item name=3D"email" title=3D"E-Mail" location=3D"?EMail"/>
<Item name=3D"phone" title=3D"Phone" location=3D"?Phone"/>
</Menu>-->
<Menu name=3D"mainMenu" title=3D"" >
<Item name=3D"ecfMenu" title=3D"ECFs" roles=3D"FISCO"
location=3D"DisconnectedEcfsSearch" />
<Item name=3D"reportsMenu" title=3D"Relat=F3rios" roles=3D"ADMIN"
location=3D"AlarmReportSearch"/>
<Item name=3D"fiscoMenu" title=3D"Fisco" roles=3D"ADMIN"
location=3D"UpdateFiscoForm"/>
<Item name=3D"alarmMenu" title=3D"Alarmes" roles=3D"ADMIN"
location=3D"AlarmNotification"/>
<Item name=3D"userMenu" title=3D"application.header.users"
roles=3D"ADMIN" location=3D"UserSearch"/>
<Item name=3D"consoleMenu" title=3D"Console" roles=3D"FISCO"
location=3D"ConsoleSearch"/>
</Menu>
And my jsp file is this:
<%@taglib uri=3D"http://struts-menu.sf.net/tag-el" prefix=3D"menu" %>
<menu:useMenuDisplayer permissions=3D"rolesAdapter" name=3D"Velo=
city"
config=3D"/WEB-INF/tabs.html"
bundle=3D"org.apache.struts.action.MESSAGE">
<menu:displayMenu name=3D"mainMenu"/>
</menu:useMenuDisplayer>
The thing is that all the menu titles are ok except for the "userMenu" titl=
e
that is displaying the key to the properties file
(application.header.users). I wanted it to get the i18n file and display th=
e
value associated with this key. I'm using struts2 and all the tutorials I
found for this are Struts1's. Need help! Don't know what else to do...
Best regards!
--001636c9247593d4d0049c68c36c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hello, I'm trying to make a custom menu for a web app and it all worked=
just fine, but now I need to internationalize it using a properties file. =
This properties file already exists and the whole app uses it. My menu-conf=
ig.xml is this: <br>
<br>=A0=A0 <Displayers><br>=A0=A0=A0 =A0=A0=A0 =A0<Displayer name=
=3D"Velocity" type=3D"net.sf.navigator.displayer.VelocityMen=
uDisplayer"/><br>=A0=A0=A0 </Displayers><br>=A0=A0=A0 <br>=A0=
=A0=A0 <Menus><br>=A0=A0=A0 =A0=A0=A0 <!--=A0 <Menu name=3D&quo=
t;ecfMenu" title=3D"ECFs" location=3D"?Contact">=
;<br>
=A0=A0=A0 =A0=A0=A0 =A0 <Item name=3D"email" title=3D"E-M=
ail" location=3D"?EMail"/><br>=A0=A0=A0 =A0=A0=A0 =A0 <=
;Item name=3D"phone" title=3D"Phone" location=3D"?=
Phone"/><br>=A0=A0=A0 =A0=A0=A0 </Menu>--><br>
=A0=A0=A0 =A0=A0=A0 <br>=A0=A0=A0 =A0=A0=A0 <Menu name=3D"mainMenu&=
quot; title=3D"" ><br>=A0=A0=A0 =A0=A0=A0 =A0 <Item name=3D=
"ecfMenu" title=3D"ECFs" roles=3D"FISCO" loca=
tion=3D"DisconnectedEcfsSearch" /><br>
=A0=A0=A0 =A0=A0=A0 =A0 <Item name=3D"reportsMenu" title=3D&qu=
ot;Relat=F3rios" roles=3D"ADMIN" location=3D"AlarmRepor=
tSearch"/><br>=A0=A0=A0 =A0=A0=A0 =A0 <Item name=3D"fiscoMe=
nu" title=3D"Fisco" roles=3D"ADMIN" location=3D&qu=
ot;UpdateFiscoForm"/><br>
=A0=A0=A0 =A0=A0=A0 =A0 <Item name=3D"alarmMenu" title=3D"=
;Alarmes" roles=3D"ADMIN" location=3D"AlarmNotification=
"/><br>=A0=A0=A0 =A0=A0=A0 =A0 <Item name=3D"userMenu"=
title=3D"application.header.users" roles=3D"ADMIN" loc=
ation=3D"UserSearch"/><br>
=A0=A0=A0 =A0=A0=A0 =A0 <Item name=3D"consoleMenu" title=3D&qu=
ot;Console" roles=3D"FISCO" location=3D"ConsoleSearch&q=
uot;/><br>=A0=A0=A0 =A0=A0=A0 </Menu><br><br>And my jsp file is th=
is:<br><%@taglib uri=3D"<a href=3D"http://struts-menu.sf.net/tag-el=
">http://struts-menu.sf.net/tag-el</a>" prefix=3D"menu" %>=
;<br>
<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <menu:useMenuDisplayer permissions=3D=
"rolesAdapter" name=3D"Velocity" config=3D"/WEB-IN=
F/tabs.html"<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 bundle=3D"=
;org.apache.struts.action.MESSAGE"><br>=A0=A0=A0 =A0=A0=A0 =A0=A0=
=A0 =A0=A0=A0 <menu:displayMenu name=3D"mainMenu"/><br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 </menu:useMenuDisplayer><br><br>The thi=
ng is that all the menu titles are ok except for the "userMenu" t=
itle that is displaying the key to the properties file (application.header.=
users). I wanted it to get the i18n file and display the value associated w=
ith this key. I'm using struts2 and all the tutorials I found for this =
are Struts1's. Need help! Don't know what else to do...<br>
<br>Best regards!<br>
--001636c9247593d4d0049c68c36c--
--===============3186152220487038909==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
--===============3186152220487038909==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
struts-menu-user mailing list
struts-menu-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/struts-menu-user
--===============3186152220487038909==--