struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Dynamic forward to jsps
Date Fri, 21 Sep 2001 14:06:22 GMT

Thanks for the reply Mike.  While the JSPs I have in mind will utilize the
i18n features of struts ( through the MessageTag class & application
resource files), I would also like the ability to use completely different
JSPs altogether.  For example, think of a languages that read from right to
left.  In these instances it would be nice to have forms with text to the
right of the the input fields.  So far I'm not sure how to best accomplish
this with Struts.


                    Michael"              To:     "''" <>
                    <michael.synovi       cc:     (bcc: Craig Reichenbach/CAM/Lotus)  
          >            Subject:     RE: Dynamic forward to jsps    
                    04:45 PM                                                             
                    Please respond                                                       
                    to struts-user                                                       

Hey Craig,

Don't know how to implement dynamic forwarding, but based on your example,
you might want to investigate how to build a single JSP to handle multiple
languages, rather than using different JSPs for different languages.

Check out the I18N (internationalization) features of Struts.


-----Original Message-----
From: []
Sent: Tuesday, September 18, 2001 11:44 AM
Subject: Dynamic foward to jsps

I have seen some discussion of dynamic forwarding in the archives as it
pertains to passing parameters.  But I haven't seen anything yet that
speaks to how one might have more than 1 "success" page.  For example,
suppose I had menu.jsp and menu_es.jsp and I wanted to dynamically forward
all requests from browsers set to accept Spanish to the Spanish jsp.

Ignoring all  realistic implications & in order to get my question across,
what comes to mind is a dynamic page attribute in struts-config, ie:

<forward name="success"  page="${}">

The value of would then correspond to an entry in the various
properties files, ie: contains: contains:

The other thought that comes to mind is for the Action class to extract the
locality from the browser or session and then set a String variable
representing the success  or failure page accordingly.   For example:

String success = "success";

if (locale == spanish)
     success = "success_es";

return mapping.findForward( success );

Meanwhile the struts-config contains multiple 'success' forwards:
<forward name="success"  page="menu.jsp">
<forward name="success_es"    page="menu_es.jsp">

This would be pretty weak and unscalable.

I appreciate your thoughts, ideas, & solutions.


View raw message