You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Franz-Josef Herpers <fj...@wir-age.de> on 2003/11/23 14:08:25 UTC

Action which always forwards back to the requesting page

Hi,

I have written an action which sets the Locale depending on the language 
choice of the user. The possibilty to choose the language should appear 
on every page of my web application. My problem know is: How can I 
configure an Action (or the forward of an Action) to always go back from 
where it was requested.

Thanks in advance
Franz


-- 
Franz-Josef Herpers
Puschkinallee 9A
12435 Berlin
030/53 21 33 02
0173/54 23 666
fjh@wir-age.de


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Action which always forwards back to the requesting page

Posted by David Friedman <hu...@ix.netcom.com>.
Franz,

Not all browsers support sending the HTTP_REFERER when you click on a page.
So, your best chances are to either:

1) Store the name of the last action in the session context so you know what
the last page is probably going to be (unless they use multiple browsers at
once when visiting your site).

2) Make your hyperlink for your locale-changing-Action dynamic so on every
page request lists the current page as a parameter to the local-changing
action. Ex: /localChange.do?page=/index.do if you're seeing /index.do,  or
/localChange.do?page=/summary.do if you're on /summary.do.  Be careful about
parameters if parameters are key to the page display.  Then you'd need to
include them in the urls, and, possibly in your redirect or forward after
you change the locale.

Regards,
David

-----Original Message-----
From: Franz-Josef Herpers [mailto:fjh@wir-age.de]
Sent: Sunday, November 23, 2003 8:08 AM
To: Struts Users Mailing List
Subject: Action which always forwards back to the requesting page


Hi,

I have written an action which sets the Locale depending on the language
choice of the user. The possibilty to choose the language should appear
on every page of my web application. My problem know is: How can I
configure an Action (or the forward of an Action) to always go back from
where it was requested.

Thanks in advance
Franz


--
Franz-Josef Herpers
Puschkinallee 9A
12435 Berlin
030/53 21 33 02
0173/54 23 666
fjh@wir-age.de


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org