Vernon:

> To my understanding, when I use the i18n tags from JSTL, I don't
> need to write any class to get locale information stored. Only task
> is to configure the locale information file. Please point it out if
> I am wrong.  If I need to use the PropertyResourceBundle class as
> the followings (this class, according to the JDK document, can't be
> subclassed by the way):

I never suggested you subclass PropertyResourceBundle. I said that
JSTL's I18N tags work with any subclass of java.util.ResourceBundle,
and the JDK happens to provide two subclasses: ListResourceBundle and
PropertyResourceBundle. I mentioned that only in the unlikely case
that neither of these fit your needs would you have to provide your
own subclass of ResourceBundle (not PropertyResourceBundle).

When using PropertyResourceBundle, all you need to provide is a
properties file containing key/value pairs. PropertyResourceBundle has
a constructor which takes an InputStream from which the properties
file is read.

For example, if you had this JSP fragment:

  <fmt:setLocale value="en-US" />
  <fmt:setBundle basename="com.acme.resources.Resources" />
  <fmt:message key="greeting" />

you would need to provide the following resource with your web application:

  com/acme/resources/Resources_en_US.properties

with these contents:

  greeting=Hi

You can also take a look at the standard-examples web application that
ships with the JSTL reference implementation. It contains example
pages that have been internationalized into German and Italian, and bundles
the corresponding properties files containing the German and Italian
localized messages.

> At this point, I am very frustrated by the fact of lacking JSTL
> documentation. I have searched all possible places and not much
> helpful information available. The document comes with JSTL doesn't
> help much. And the jwsdp document mentions JSTL, but still not much
> on i18n. I guess that I shall use i18n tags other than
> JSTL.

Please note that JSTL leverages the I18N support provided by the JDK.
on which there is a good tutorial at:

  http://java.sun.com/docs/books/tutorial/i18n/

Also, 3 books (that I am aware of) covering JSTL will be out shortly.


Jan




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to