>>>>> Struts Newsgroup (@Basebeans.com) <[EMAIL PROTECTED]>:
> Now the question is:
> 1.I want to setLocale() by the value get from request.getLocale(),
> but how can I set the struts to automaticlly finish this process.
This happens automatically, I think, if you don't override it by
setting the Action.LOCALE_KEY attribute on the session.
> 2.How can I set the web to make jsp also automaticlly encoding the
> content using the client locale setting.
If you mean, "how can I change the output language based on the
browsers' locale settings?", then the answer in Struts 1.0, is that
you can use the <bean:message> tag to look up a language dependent
text from a resource bundle.
Eg. if you have the file MyResources.properties containing
helloworld=Hello World!
and the file MyResources_no.properties containing
helloworld=Hei Verden!
both at the top level of the WEB-INF directory, and put
<servlet>
...
<init-param>
<param-name>application</param-name>
<param-value>MyResources</param-value>
</init-param>
...
</servlet>
in the web.xml file, then using
<bean:message key="helloworld"/>
will render the text "Hei Verden!" if the browser's locale is "no",
and "Hello World!" for all others.
See
<http://www.anassina.com/struts/i18n/i18n.html>
for some tips.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>