Well, I found why I was seeing the behavior. Basically, I have an
index.jsp that is the welcome page of my app. It uses a bean:message tag
to display a message. By default, if the bean:message tag cannot find a
locale in the session; then it uses the locale from the request header.
So even though I had set <controller locale="false"/> the
RequestProcessor never came into play.
Bill Siggelkow wrote:
Thanks for the info, Craig. I had tried the first option and I did not
seem to "take" but I need to dig a little deeper. The other two options
I will consider -- one you didn't mention that I thought of was using a
plug-in.
Craig McClanahan wrote:
Here's at least three different ways to do what you are after:
* Turn off the normal Locale processing behavior in
struts-config.xml:
<controller ... locale="false" .../>
* Use a Filter, or some utility method called by your Action,
to store a Locale object in the session under the key specified
by Globals.LOCALE_KEY before the JSP page is called.
The Locale found here is what controls the language used
when the page is actually rendered, and the default logic is
invoked only if there is no such object present.
* Define your own RequestProcessor subclass and override
the processLocale() method to do whatever you want. The
default implementation is the one that selects the locale
based on the Accept-Language header.
Craig
On Fri, 10 Sep 2004 22:41:49 -0400, Bill Siggelkow
<[EMAIL PROTECTED]> wrote:
I18N Gurus,
I am trying to find out if it is possible to configure Struts to ignore
the brower's language but I can't seem to get it to work. I have set my
browser's lang to Russian -- in struts-config I have:
<controller locale="false"/>
On the page I am just using:
<html>
...
<bean:message key="index.welcome"/>
</html>
The message tag always returns the value from Russian bundle -- I am
trying to instead have it use the server's locale (en_US). Generally, I
know, this is not what you would want -- I am just trying to figure out
if it is possible to have Struts *not* use the value from the
accept-header.
I have also tried using <html:lang="false"> but this doesn't seem to
work either.
-Bill Siggelkow
---------------------------------------------------------------------
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]