struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: Configure result to go back to page I came from....
Date Fri, 19 Sep 2008 19:25:36 GMT
The simplest thing would be to have your 'switchlanguage' action method 
return a 'well known' result name, and map that result in each action. 
Since this is for input forms, you probably already have an 'input' 
result mapped for each action, so you could just have 'switchlanguage' 
return 'input' to get the behaviour you're looking for.

If that doesn't work, I don't know of an easy solution without adding 
logic to track the user's navigation and retain (at least partially) a 
history of where they've been. Without an explicit result mapping to 
forward to, you'd have to work out what was the action+result 
combination of the request prior to the current one, which isn't 
information that the framework retains or exposes as far as I know...

L.

Volker Karlmeier wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> I think I have to explain my problem more clearly:
> 
> I have a page that show some text-fields. These Text-Fields can be 
> filled in different languages.
> To choose the according language, you can click on a button (e.g. 
> english/french etc.) and a method "switchlanguage" is called,
> which sets a parameter to the language I want to enter.
> As I need this function on various pages, I want to implement it in a 
> superclass of my action class.
> After clicking on a language-button, I need to set the language and go 
> back to the form to enter the text.
> Therefore, I need a way to react on a result called "languageSwitched" 
> which leads to the page I just came from.
> As I do not want to write it in every action but only once in 
> struts.xml, I need a result that goes back to that page
> without having to specify each time, which page that was.
> Is that possible ?
> 
> ~  Volker
> 
> 
> Paweł Wielgus schrieb:
> | Hi Volker,
> | where it should go when i will open my browser window (blank) and type
> | Your action url?
> |
> | Best greetings,
> | Paweł Wielgus.
> |
> | 2008/9/18 Volker Karlmeier <volker@magiccode.eu>:
> | Hello Struts-Freaks,
> |
> | I have a quite easy question, I think:
> |
> | how can I configure an action in struts.xml, that does nothing than go to
> | the page I came from ?
> | Something like <result name="success" /> or so ?
> |
> | Thanks in advance.....
> |
> | ~  Volker
> |
> |
> |>
> |>
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> |>
> |>
> 
> - --
> - -------------------------------
> 
> Volker Karlmeier
> Friedrich-Freye-Str. 61
> 45481 Mülheim/Ruhr
> 
> Tel. :  (+49) 208-7785675
> Mobil:  (+49) 176-21056587
> Mail :  Volker@magiccode.eu
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> 
> iD8DBQFI0sSkaEMQXBIqssERAqkuAJ0U44scceFNB5DJ2PljMdx1Op/0rgCfeahV
> 8TQELRYohqOMGZKsDCo7Jck=
> =yU7g
> -----END PGP SIGNATURE-----
> 
> 



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


Mime
View raw message