I'm sure you can do something more intelligent than duplicating the whole
set of jsps for each different language. If the problem is that you need
different images for different languages then write your own tag to generate
the path for the image based on the localle.

IMHO I wouldn't resolve your issue this way, BUT...

....you could sub-class Action and do something like the following:


public class LocalAction extends Action {

    public ActionForward perform(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response) throws
IOException, ServletException  {

        ActionForward forward = super.perform(mapping, form, request,
response);

        String prefix = getLocale(request).getISO3Language();

        if (prefix == null || prefix.length() ==0)
            return forward;
        else
            return new ActionForward(prefix + '/' + forward.getPath());

    }

}


Niall

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 11 June 2002 12:54
> To: [EMAIL PROTECTED]
> Subject: RE: Dealing with many JSP files with one Action
>
>
>
> ---------------------- Envoyée par Olivier Schmeltzer/QVI/GRAF/FR le
> 11/06/2002 13:43 ---------------------------
>
>
> Olivier Schmeltzer
> 11/06/2002 09:01
>
> Pour : [EMAIL PROTECTED]
> cc :   [EMAIL PROTECTED]> (ccc : Olivier
>        Schmeltzer/QVI/GRAF/FR)
>
> Objet :     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. 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.
> 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 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:struts-user-> [EMAIL PROTECTED]>
> For
> additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>


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

Reply via email to