Michael, thank you very much for your fast response. You're idea sounds really interesting and might be a really good solution. May I ask you a few more questions:
Concerning 1.: Where exactly should I check for the GET or the POST-Request. Would you recommend to check for the GET/POST-Method in every execute-method of an actionclass or is there a better (unique) place to check for that. I thought about extending the RequestProcessor, but this doesn't seem to work, becuase I need the mapping.findForward()-information of my execute-method to know where to go (at least I guess so, if there´s no other way). Is it necessary to create a FORM to have the POST-Request or is it also possible the way I showed with the "switchLanguage.do?lang=en"-way? What do you mean by redirect? Does this have anything to do with the redirect=true/false entry in the RedirectActionForward or the struts-config.xml or is this a basic HTTP-Concept? Concernig 2: What other possibilities do I have to find my refering page if not with the HTTP-Headers or the RequestURL()? I didn't find another place for this information. Most of the given objects (e.g. mapping) only showed me information about the current page, but not the refering-page. I hope, this aren´t to many questions, but I really didn´t find any information on this topic. Thank you in advance Thomas On Monday 07 November 2005 18:05, Michael Jouravlev wrote: > On 11/7/05, Thomas Hamacher <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > > > I have the following problem and cannot find a real solution to it. > > Usually this should be a common and known problem, so I'm wondering if I > > anyone has found a solution to this. > > > > I have internationalized my struts 1.2.7 application through tiles and > > the use of ResourceBundle an java.util.Local. > > Now I want to add a few buttons (one for every language) with which I can > > change the language on every page (as seen in many international > > webseites). My first idea was to create an action that changes the locale > > and redirects back to page. > > ... > > > The change of the locale works perfectly and the new values are displayed > > on the page. The only problem I have right know is, that if my "referer" > > was a ".do"-page, the execute-method of my action-class is called and > > executed again (see my other posting). So this cannot be the solution. If > > I manually remove the .do in my referer-string, the action-class isn't > > called anymore but the refering page is wrong. > > 1) Do not use referer - it is unreliable, especially with reloads and > history navigation. Also, many firewalls strip out "refer" header. > > 2) To ensure that your action does not execute twice, check the > request method. When you click "language" button, browser submits a > POST request. You need to process that. When you redirect to the same > action, browser sends a GET request, and you do not need to process it > (unless you have "command links" on a page). > > Michael. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]