Java Internationalization Programming
Message

The 'ResourceBundle' class loads resource data according to the specified locale (if no one specified, the system locale will be used), and the localized data such as messages, lables, and images can be switched to user locale ones by this class.

The codes of calling ResourceBundle is the following.
ResourceBundle wwnaviBundle = 
    ResourceBundle.getBundle("wwnavi_rs"); <-- *"wwnavi_rs" is a property file name (see the next section).
*If you call the ResourceBundle in JSP/Servlet, you have to apply the locales of HTTP requests, so the codes need changed. Please refer to Server Side Programming for more details.

The following is the basic ResourceBundle usage.
  1. Resource File (Property File) Creation

  2. Describe the Message Loading.

  3. The location of the .properties files

This process can be checked with Java/JSP string externalization samples in World Wide Navi.

Go to International Programming Top


Copyright (C) 2012 Kokusaika JP, Inc.
All rights reserved. No reproduction or republication without written permission.
span> </bo