Thank you. I suspect this too. But how can I "force" Tapestry to attach the engine to the session? And if it was not attached, then when engine.setLocale() was called, it should just give an error?
Henry -----Original Message----- From: Jamie Orchard-Hays [mailto:[EMAIL PROTECTED] Sent: Thursday, July 14, 2005 10:57 AM To: Tapestry users Subject: Re: About engine My first thought is that it has something to do with not having a session attached yet. Others can correct me if I'm wrong, but I think Tapestry won't attach an engine to your session until it's needed. Perhaps your setlocale isn't sticking until you've got a Tapestry session going. Try exploring that direction. Henry Chen wrote: > I asked the following question yesterday and nobody so far gave me a hint > yet. Let me describe it in a different way. When I opened the website, if > the first thing I do is to click on the link that is supposed to do > engine.setLocale(), this change would fail. But if I do something first, > like login or click on "inspector", and then return to click on the link > that is supposed to do engine.setLocale(), it would be successful. Can > anybody give me some clue where I should look at for the problem? This has > been annoying me for a month. Many many Thanks!! > > Henry > > > > > > > > -------------------------------------------------------------------------- > > I have a link on my login page that can change the language of the website. > I developed the website on a windowsXp machine with tomcat-5.0.28/java5. > When I tested it by clicking on the language change link, it worked > perfectly. > > But when I moved the whole thing to a live server, it didn't work any more, > the page didn't change to the language selected. The only difference I can > tell is that it is Windows server 2000 instead of XP, other environments are > the same - tomcat 5.0.28/java5. There are two things that I noticed which > maybe clues: 1. If I login already, the link worked. 2. If I click on the > "Tapestry Inspector" button, then return to the login page to change the > language, it worked too. > > This weird behavior happened to some of my other pages that stores values in > session too. It seems tapestry keep forgetting the values. Can somebody > point out where the problem is? Thanks a lot! > > The language link itself is actually a component, when clicked, it will do > the following: > > public void changeLanguage(IRequestCycle cycle) { > > int index = ((Integer)cycle.getServiceParameters()[0]).intValue(); > > getPage().getEngine().setLocale((Locale)AVAIL_LOCALES.get(index)); > > throw new > RedirectException(getPage().getEngine().getService(Tapestry.PAGE_SERVICE) > > .getLink(cycle, null, new String[] {"Home"}).getURL()); > > } > > Henry > > > > --------------------------------------------------------------------- > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
