On Mon, 15 Jul 2002, Kurosaka, Teruhiko wrote:
> Date: Mon, 15 Jul 2002 18:33:53 -0700
> From: "Kurosaka, Teruhiko" <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Cc: "Kurosaka, Teruhiko" <[EMAIL PROTECTED]>
> Subject: What does locale="true" really do?
>
> Hello,
> Various documents suggest that we are supposed to say:
> <html:html locale="true">
> in Struts-based JSP files. This directive somehow sets
> the locale automatically, as I understand it.
> But I am wondering exactly how Struts sets a locale.
> Does anyone know?
>
The implementation of this tag grabs the current locale from the session
(set from either a call to request.getLocale() or later updated by the
application) and uses that to set the "lang" attribute on the <html> tag.
> I am hoping that Struts won't just blindly pick up the
> language of the heaviest weight in the request's
> Accept-Language header, because that is simply
> wrong. When there is no German version of a .jsp
> file, "accept-language: de" should not be honored,
> for example. I am hoping that somehow Struts knows
> the list of available languages for a page, but I cannot
> seem to locate that description. Does anyone know
> anything about it?
>
Struts doesn't know anything about this, because "languages available" is
an application specific concept. However, your application is
free to set the Locale (in the session, under key Action.LOCALE_KEY) to
whatever you think is correct.
Craig
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>