I've made two ResourceBundles
One TestAppResource.properties (containg English text) and one 
TestAppResource_no.properties. (Norwegian)

In the first page the user sees, index.jsp, I have
<bean:message key="title.welcome"/>

The English text comes up, no matter what the "Language" setting is set to
in Netscape.
Note that there is no form "connected" to this index.jsp, it's just an
jsp page producing HTML.

However, I have mainmenu.jsp page, which also contains <bean:message>,
and this prodouces the text for the correct langauge.

The documentation for <bean:message> says :
The name of the session scope bean under which our currently selected Locale 
object is stored. If not specified, the default name (the value of the 
Action.LOCALE_KEY constant string) is used.


1. Does this mean that the Locale is not set correctly before an Action has
been created / called ?
After reading some more docs before sending this mail, I assume that I
may need to set the locale parameter to true for the ActionServlet in
the web.xml file. I will try this

2. If I have a message main.welcome=Welcome {0},
and I want to get the {0} text from the bean User via a call to getUser(),
how would the <bean:message> look like ?
<bean:message key="main.welcome" arg0="?????????"/>
I see there is a <bean:parameter>, but don't understand how to use it.
(I'm a novice in JSP as well)

3. The XHTML and HTML4.0 standard says that there should be an attribute
on the <html> tag specifying the language, a la
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

How do I construct the value of the xml:lang and lang attributes dynamically ?
That is :  
a) how do I get hold of the language, even assuming no Action
has yet been called ?
b) how do I set the value of the attribute, this is probably the same
question as 2.

Regards
Alf Hogemark

Reply via email to