You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Partha Chakraborty <pa...@ontrackindia.com> on 2011/04/15 11:09:38 UTC

RE: Handling navigation language in the URL

You can send that as parameter

Partha Chk

-----Original Message-----
From: GF [mailto:ganfab@gmail.com] 
Sent: Saturday 7 May 2011 1:53 PM
To: Struts Users ML
Subject: Handling navigation language in the URL

Hello i've a site that behave this way:

ContextPath = /myapp

Namespace = /user
Action = view

So, I deploy an application called mypath.war and I handle urls like:

/myapp/user/view.action

I wish to handle "multilanguage" and i wish to handle it in the url,
like /en /de /fr /de and so on.

Since i wrote correctly my application, it is context path
indipendent, so, the most stupid thing to do is to deploy en.war
de.war fr.war and so on.

Of course this is very "stupid" since it would be very memory consuming.

Is there in Java EE a way to deploy ONCE the same .war and making it
to handle multiple context paths? I use Tomcat 6.

I didn't find anything for this.. the only thing I found, causes
anyway a multiple deploy of the same .war

Can you suggest me an alternative approach?
Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Handling navigation language in the URL

Posted by Martin Gainty <mg...@hotmail.com>.
<!-- assuming this jsp page -->
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>title</title>
</head>
<body>
<s:url id="localeEN" namespace="/" action="locale" >
   <s:param name="request_locale" >en</s:param>
</s:url>
<s:url id="localezhCN" namespace="/" action="locale" >
   <s:param name="request_locale" >zh_CN</s:param>
</s:url>
<s:url id="localeDE" namespace="/" action="locale" >
   <s:param name="request_locale" >de</s:param>
</s:url>
<s:url id="localeFR" namespace="/" action="locale" >
   <s:param name="request_locale" >fr</s:param>
</s:url>
 
<s:a href="%{localeEN}" >English</s:a>
<s:a href="%{localezhCN}" >Chinese</s:a>
<s:a href="%{localeDE}" >German</s:a>
<s:a href="%{localeFR}" >France</s:a>
</body>
</html>

#in resources folder place all normal messages into global.properties
#Global messages for english
global.username = Username
global.password = Password
global.submit = Submit

#global_zh_CN.properties:
#Global messages
global.username = \u7528\u6237\u540d
global.password = \u5bc6\u7801
global.submit=\u63d0\u4ea4

#global_fr.properties
#Global messages
global.username = Nom d'utilisateur
global.password = Mot de passe
global.submit = Soumettre

#global_de.properties
#Global messages
global.username = Benutzername
global.password = Kennwort
global.submit = Einreichen
//under action folder place Action specific messages in localised properties
*Action_de.properties
*Action_fr.properties
*Action_en.properties
*Action_zh_CN.properties

http://www.mkyong.com/struts2/struts-2-i18n-or-localization-exampleMartin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.






> From: partha@ontrackindia.com
> To: user@struts.apache.org
> Subject: RE: Handling navigation language in the URL
> Date: Fri, 15 Apr 2011 14:39:38 +0530
> 
> You can send that as parameter
> 
> Partha Chk
> 
> -----Original Message-----
> From: GF [mailto:ganfab@gmail.com] 
> Sent: Saturday 7 May 2011 1:53 PM
> To: Struts Users ML
> Subject: Handling navigation language in the URL
> 
> Hello i've a site that behave this way:
> 
> ContextPath = /myapp
> 
> Namespace = /user
> Action = view
> 
> So, I deploy an application called mypath.war and I handle urls like:
> 
> /myapp/user/view.action
> 
> I wish to handle "multilanguage" and i wish to handle it in the url,
> like /en /de /fr /de and so on.
> 
> Since i wrote correctly my application, it is context path
> indipendent, so, the most stupid thing to do is to deploy en.war
> de.war fr.war and so on.
> 
> Of course this is very "stupid" since it would be very memory consuming.
> 
> Is there in Java EE a way to deploy ONCE the same .war and making it
> to handle multiple context paths? I use Tomcat 6.
> 
> I didn't find anything for this.. the only thing I found, causes
> anyway a multiple deploy of the same .war
> 
> Can you suggest me an alternative approach?
> Thank you.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
 		 	   		  

Re: Handling navigation language in the URL

Posted by GF <ga...@gmail.com>.
Yes, but i want to make some nice SEO urls.
Thanks anyway

On Fri, Apr 15, 2011 at 11:09 AM, Partha Chakraborty
<pa...@ontrackindia.com> wrote:
> You can send that as parameter
>
> Partha Chk
>
> -----Original Message-----
> From: GF [mailto:ganfab@gmail.com]
> Sent: Saturday 7 May 2011 1:53 PM
> To: Struts Users ML
> Subject: Handling navigation language in the URL
>
> Hello i've a site that behave this way:
>
> ContextPath = /myapp
>
> Namespace = /user
> Action = view
>
> So, I deploy an application called mypath.war and I handle urls like:
>
> /myapp/user/view.action
>
> I wish to handle "multilanguage" and i wish to handle it in the url,
> like /en /de /fr /de and so on.
>
> Since i wrote correctly my application, it is context path
> indipendent, so, the most stupid thing to do is to deploy en.war
> de.war fr.war and so on.
>
> Of course this is very "stupid" since it would be very memory consuming.
>
> Is there in Java EE a way to deploy ONCE the same .war and making it
> to handle multiple context paths? I use Tomcat 6.
>
> I didn't find anything for this.. the only thing I found, causes
> anyway a multiple deploy of the same .war
>
> Can you suggest me an alternative approach?
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org