I have a very common user requirement, that is, to allow switching the locale on every page.
I can easily write an action which take the selected locale and the invoking page as input and forward the response back to the invoking page. However, if that invoking page is the result of some action, e.g. the search result page of a search action, and that search result is stored in the request scope, then after the language switch the page will display an empty list (or even broken!). I reckon it *may* be possible to invoke the language switch with the incoming action as a parameter (that is not trivial right?), but that incoming action may be a money transfer action that I don't want it to repost. So *tada* I figured out a *I thought it was smart* way to handle this. I wrote a custom tag and put it on every page that can switch language. This tag will save a copy of all the references to objects in the request scope in a single buffer in the session just before the page get displayed. If you switch language, I just restore all those objects back into request scope. This works like a charm (well, for those enumeration I have to do some tricks but that's ok...). I don't even need an action, this tag will handle this. I just put a link resultPage.jsp?locale=fr_CA and then this tag will do all the work or switching locale object in session and restoring the request scope objects. Ok then I saw how this would break down when the user opens 2 browsers for the same session because I only have a single page buffer for the references to the request scope objects. My questions are: 1) Any one has a genuine solution to this requirement? Am I on the right path or am I totally off? 2) Anyone see a dirty hack to my *not so smart* solution? Thanks, Joe _________________________________________________________________ �b�z����ʸ˸m�W�ǰe���� Hotmail �l��A�в��� http://mobile.msn.com�C -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

