i18n url link problem

2005-06-07 Thread Braun, James F
I have a struts app that needs to change a link's url as well as the
title. That is, the url for the product catalogs are different for
Germany and US as well as the titles.

en_US
link.title=Products
link.url=http://www.myUScompany.com/products
de_DE
link.title=Produkte
link.url=http://www.myDEcompany.com/catalog

I have no problem with the title but getting the url into the href=~
part of the tag on the .jsp page is driving me nuts!

Here is the history of my logic for a top bar menu link: (referring to
the property file above)

I started with: 
html:link styleClass=topNavLink
href=http://www.myUScompany.com/products;
Products 
/html:link

I converted the title phrase to i18n which worked fine: 
html:link styleClass=topNavLink
href=http://www.myUScompany.com/products;
bean:message key=link.title/ 
/html:link

I tried to convert the link to i18n like this: 
html:link styleClass=topNavLink href=bean:message
key=link.url/ 
bean:message key=link.title/ 
/html:link

This failed as well as everything else I tried to get the localized url
into the html:link. I tried html:write but since I'm new to struts I
don't have any confidence that I did it correctly. I'm sure that there
must be a way to do this since I can't be the only one with this
problem.

TIA, J.

-- 
This transmission is intended only for use by the addressee(s) named herein and 
may contain information that is proprietary, confidential and/or legally 
privileged. If you are not the intended recipient, you are hereby notified that 
any disclosure, copying, distribution, or use of the information contained 
herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received 
this transmission in error, please immediately contact the sender and destroy 
the material in its entirety, whether in electronic or hard copy format. Thank 
you.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18n url link problem

2005-06-07 Thread gdeschen
The problem is that you have a tag nested within a tag.
In order to do this you need to use the html-el:link tag. The el is 
Expression Language.
However, I am having difficulties with applying the el tags... so I cannot 
yet help you.

One quick way around this is to do it this way:
a class=topNavLink href=bean:message key='link.url'/
   bean:message key=link.title/ 
/a

HTH,
Glenn




Braun, James F [EMAIL PROTECTED] 
07/06/2005 02:59 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
i18n url link problem






I have a struts app that needs to change a link's url as well as the
title. That is, the url for the product catalogs are different for
Germany and US as well as the titles.

en_US
link.title=Products
link.url=http://www.myUScompany.com/products
de_DE
link.title=Produkte
link.url=http://www.myDEcompany.com/catalog

I have no problem with the title but getting the url into the href=~
part of the tag on the .jsp page is driving me nuts!

Here is the history of my logic for a top bar menu link: (referring to
the property file above)

I started with: 
html:link styleClass=topNavLink
href=http://www.myUScompany.com/products;
 Products 
/html:link

I converted the title phrase to i18n which worked fine: 
html:link styleClass=topNavLink
href=http://www.myUScompany.com/products;
 bean:message key=link.title/ 
/html:link

I tried to convert the link to i18n like this: 
html:link styleClass=topNavLink href=bean:message
key=link.url/ 
 bean:message key=link.title/ 
/html:link

This failed as well as everything else I tried to get the localized url
into the html:link. I tried html:write but since I'm new to struts I
don't have any confidence that I did it correctly. I'm sure that there
must be a way to do this since I can't be the only one with this
problem.

TIA, J.

-- 
This transmission is intended only for use by the addressee(s) named 
herein and may contain information that is proprietary, confidential 
and/or legally privileged. If you are not the intended recipient, you are 
hereby notified that any disclosure, copying, distribution, or use of the 
information contained herein (including any reliance thereon) is STRICTLY 
PROHIBITED. If you received this transmission in error, please immediately 
contact the sender and destroy the material in its entirety, whether in 
electronic or hard copy format. Thank you.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: i18n url link problem

2005-06-07 Thread Martin Gainty

Right off the bat I assume you included in your taglib's e.g.
%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib uri=/tags/struts-bean prefix=bean %
%@ taglib uri=/tags/struts-html prefix=html %
at top of your jsp?
then you must dynamically create the href so using html:rewrite will help 
instead of link

html:rewrite href=bean:message key=link.url/
The doc is available at
http://struts.apache.org/userGuide/struts-html.html#rewrite

Viel Gluck,
Martin-

- Original Message - 
From: Braun, James F [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, June 07, 2005 2:59 PM
Subject: i18n url link problem


I have a struts app that needs to change a link's url as well as the
title. That is, the url for the product catalogs are different for
Germany and US as well as the titles.

en_US
link.title=Products
link.url=http://www.myUScompany.com/products
de_DE
link.title=Produkte
link.url=http://www.myDEcompany.com/catalog

I have no problem with the title but getting the url into the href=~
part of the tag on the .jsp page is driving me nuts!

Here is the history of my logic for a top bar menu link: (referring to
the property file above)

I started with:
html:link styleClass=topNavLink
href=http://www.myUScompany.com/products;
Products
/html:link

I converted the title phrase to i18n which worked fine:
html:link styleClass=topNavLink
href=http://www.myUScompany.com/products;
bean:message key=link.title/
/html:link

I tried to convert the link to i18n like this:
html:link styleClass=topNavLink href=bean:message
key=link.url/
bean:message key=link.title/
/html:link

This failed as well as everything else I tried to get the localized url
into the html:link. I tried html:write but since I'm new to struts I
don't have any confidence that I did it correctly. I'm sure that there
must be a way to do this since I can't be the only one with this
problem.

TIA, J.

--
This transmission is intended only for use by the addressee(s) named herein 
and may contain information that is proprietary, confidential and/or legally 
privileged. If you are not the intended recipient, you are hereby notified 
that any disclosure, copying, distribution, or use of the information 
contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If 
you received this transmission in error, please immediately contact the 
sender and destroy the material in its entirety, whether in electronic or 
hard copy format. Thank you.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]