You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gd...@cmhc-schl.gc.ca on 2004/06/03 19:45:05 UTC
One Forward Action Multiple JSPs
Greetings,
What I would like to do is to be able to display different JSPs for the
same ForwardAction.
I now have this:
<action path="/TermsAndConditions"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/secure/credentials/termsAndConditions.jsp">
</action>
What I would like is based on the Locale show a different JSP.
I cannot use the i18n for this with resource bundles since the page
contains lots of text and the format is different for both languages.
So if I create my own ForwardAction
(secure.credentials.TermsAndConditionsForwardAction) how would I set the
parameter value to either
/WEB-INF/secure/credentials/termsAndConditions_en.jsp
or
/WEB-INF/secure/credentials/termsAndConditions_fr.jsp
Is this the best way to go about or are there other suggestions?
TIA,
Glenn.
RE: One Forward Action Multiple JSPs
Posted by "Kunal H. Parikh" <ku...@carsales.com.au>.
Hi Glenn!
I would recommend creating an "Action", with two action-forwards:
1. TermsAndConditions_default
2. TermsAndConditions_fr
In Action.execute, detect the appropriate locale and forward control to the
appropriate action-forward.
HTH,
Kunal
-----Original Message-----
From: gdeschen@cmhc-schl.gc.ca [mailto:gdeschen@cmhc-schl.gc.ca]
Sent: Friday, 4 June 2004 03:45
To: user@struts.apache.org
Subject: One Forward Action Multiple JSPs
Greetings,
What I would like to do is to be able to display different JSPs for the
same ForwardAction.
I now have this:
<action path="/TermsAndConditions"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/secure/credentials/termsAndConditions.jsp">
</action>
What I would like is based on the Locale show a different JSP.
I cannot use the i18n for this with resource bundles since the page
contains lots of text and the format is different for both languages.
So if I create my own ForwardAction
(secure.credentials.TermsAndConditionsForwardAction) how would I set the
parameter value to either
/WEB-INF/secure/credentials/termsAndConditions_en.jsp
or
/WEB-INF/secure/credentials/termsAndConditions_fr.jsp
Is this the best way to go about or are there other suggestions?
TIA,
Glenn.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org