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="${user.succes.page}">

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

AppResources.properties contains:
user.success.page=menu.jsp

AppResources_es.properties contains:
user.successpage=menu_es.jsp



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.

Thanks,
Craig

Reply via email to