Yes, I understand what you need.

You are trying to use Struts to forward to a jsp depending on Locale (and
some other param).
I'm not sure how you plan to capture from the user's 'param' such as
country.
Perhaps your own authentication mechanism is storing the "user to country"
relation.

Still, I think you'd be better off structuring your site to use one
codebase.

Here's an example of what I mean:
(I'm typing this as I go, so forgive me if I miss something)


+ app
  + i18n
    + en
      + images
      + stylesheets
      + (other web content)
    + fr
      + images
      + stylesheets
      + (other web content)
    + de
      + images
      + stylesheets
      + (other web content)
  + WEB-INF
    + classes
    + lib
    + jsp
    + tld
    + xml

#1. Then in you create ApplicationResources.properties
----------------------------------------------------
images.logo={0}/images/logo.gif
images.logo.alt=Company Logo
global.title=My i18n website

#2. Now, create a ApplicationResources_fr.properties
----------------------------------------------------
images.logo={0}/images/frenchlogo.gif
images.logo.alt=Logo De Compagnie
global.title=Mon website d'i18n

#3. also create one for German (ApplicationResources_de.properties)
images.logo={0}/images/germanlogo.gif
images.logo.alt=Firma-Firmenzeichen
global.title=Mein i18n website


When displaying the html:img, be sure to insert the locale.
Now, your content is separated from your code.

"Use the force Luke".....

1 Codebase - Many Languages


Do you see how easy it is?  All you have to do is copy
the 'en' file structure, the rename 'en' to whatever.  Then
have your folks update with that language versions.
    + en
      + images
      + stylesheets
      + (other web content)
Also create a ApplicationResources_{lang}.properties
where {lang} is the two letter abrev. for the locale


The same codebase will correctly use the version for
the users locale.  You may need to specify local for
misc items like .css or other files (.swf, .js, .xls).


If this makes no sense to you....
Please read:
http://husted.com/struts/FAQ/view-i18n.htm


Let me know if you have further issues.


James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://struts-atlanta.open-tools.org







> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 3:19 AM
> To: [EMAIL PROTECTED]
> Subject: Réf. : RE: Dealing with many JSP files with oneAction
>
>
>
> Hi !
>
> Well, either I did not explain my problem well enough or I don't
> understand
> your solution.
> You said "So that way you can forward to the jsp for the appropriate
> language.
> And each jsp will refer to its appropriate images."
> I don't understand how I am going to forward to the right jsp file in the
> right directory without writing it down explicitely in my
> struts-config.xml
> file.
> Suppose I use the ForwardAction class ; what should I put inside the
> 'parameter' attribute so that it will forward to the right file in the
> right directory relatively to the page I am currently seeing in my browser
> ?
> I understand that i18n allows me to choose files (jsp, images, or
> whatever)
> depending on my Locale, but in my case, the Locale is not the only
> parameter : the country and the language are going to be important on the
> decision making. So I am going to have a french site in french,
> but also an
> english version of the french site, the same for Spain, etc.
> Sorry if my questions are too basic, and thanks again for taking the time
> to answer me.
>
> Olivier Schmeltzer
>
>
>
>
>
> [EMAIL PROTECTED] le 11/06/2002 16:28:38
>
> Veuillez répondre à <[EMAIL PROTECTED]>
>
> Pour : <[EMAIL PROTECTED]>
> cc :
>
> Objet :     RE: Dealing with many JSP files with one Action
>
>
> First of all, it helps to include the original text....or at
> least part it:
>
> James Mitchell wrote:
> > Have you considered taking advantage of Struts i18n capabilities?
> >
> > By stripping out all display text (including button values)
> > into the message resource files, you can better manage the content
> > display by managing your i18n-ed files.
> >
> > You will realize the return on investment almost immediately if
> > you were to.....oh lets say .....change the workflow of your
> > site, or change the layout.  You would only have to make the change
> > in one place and not multiple files.
> >
>
> I'll add my comments below.
>
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network"
> http://struts-atlanta.open-tools.org
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, June 11, 2002 3:02 AM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]>
> > Subject: RE: Dealing with many JSP files with one Action
> >
> >
> > Thanks for your answer. Unfortunately, I am not able to modify the
> > directory structure and all the way this is going to work.
>
> I didn't say anything about modifying the dir structure
>
> > We don't want to just have the text in multiple languages : images
> > also have to be different;
> > everything can be modified by marketing people (from different
> > countries)
> > who don't develop the Internet site, through a Content Management System
> > tool.
>
> By now it has become apparent that you might not be familiar with what I
> was referring to (i18n - Struts style)
>
> let's say that you need main.jsp:
> ----------------------------------------
> <html>
>  <title>Hello and Welcome</title>
> <head></head>
> <body>
> This is in English<br>
> <img src="/myservlet/en/images/logo.gif">
> </body>
> </html>
>
>
> Ok, now if i understand you correctly.  You copy this file (and
> every other file with site content) under a dir structure like:
> /myservlet/en/jsp/main.jsp
> /myservlet/de/jsp/main.jsp
> /myservlet/fr/jsp/main.jsp
> /myservlet/jp/jsp/main.jsp
>
> You would also have an images directory for each language supported.
>
> So that way you can forward to the jsp for the appropriate language.
> And each jsp will refer to its appropriate images.
>
> Am I missing anything?
>
> If I'm correct in my assumptions, then I have some good news for you.
> Please let me know.
>
>
>
> > The example I chose was meant to be simple, but it is actually much more
> > complicated than this.
> > So, I repeat my question : is there a way for a single Action to serve
> > multiple JSP files, by taking advantage of a relative path ?
> > If the current JSP page I am viewing now is /FR/home/home.jsp, can I put
> > inside this page an action (let's say a ForwardAction) that will show me
> > the /FR/logon/logon.jsp ? And I want to use the same flow
> > description to go
> > frome the /EN/home/home.jsp file to the /EN/logon/logon.jsp ?
> > The following does not work but it gives the idea :
> >
> >       <action path="/homeLogonRel"
> >             type="org.apache.struts.actions.ForwardAction"
> >             parameter="../logon/logon.jsp">
> >       </action>
> >
> > Thank you for your time.
> >
> > Olivier Schmeltzer
> >
> >
> >
> >
> > ----------------
> >
> > Les donnees et renseignements contenus dans ce message sont
> > personnels, confidentiels et secrets. Ce message est adresse a
> > l'individu ou l'entite dont les coordonnees figurent ci-dessus.
> > Si vous n'etes pas le bon destinataire, nous vous demandons de ne
> > pas lire, copier, utiliser ou divulguer cette communication. Nous
> > vous prions de notifier cette erreur a l'expediteur et d'effacer
> > immediatement cette communication de votre systeme.
> >
> > The information contained in this message is privileged,
> > confidential, and protected from disclosure. This message is
> > intended for the individual or entity adressed herein. If you are
> > not the intended recipient, please do not read, copy, use or
> > disclose this communication to others ;also please notify the
> > sender by replying to this message, and then delete it from your system.
> >
> >
>
>
>
>
>
>
>
>
> ---------------
>
> Les données et renseignements contenus dans ce message sont
> personnels, confidentiels et secrets. Ce message est adressé à
> l'individu ou l'entité dont les coordonnées figurent ci-dessus.
> Si vous n'êtes pas le bon destinataire, nous vous demandons de ne
> pas lire, copier, utiliser ou divulguer cette communication. Nous
> vous prions de notifier cette erreur à l'expéditeur et d'effacer
> immediatement cette communication de votre système.
>
> The information contained in this message is privileged,
> confidential, and protected from disclosure. This message is
> intended for the individual or entity adressed herein. If you are
> not the intended recipient, please do not read, copy, use or
> disclose this communication to others ;also please notify the
> sender by replying to this message, and then delete it from your system.
>
>


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

Reply via email to