Thursday, November 15, 2007

Internationalizing Woodstock components

Project Woodstock offers a set of very useful JSF components, some of which are included by default in NetBeans 6.0. The labels, messages etc used by these components can be internationalized by following these steps:

  1. Create a new resource bundle properties file woodstock.properties. An existing one can be used, but it's better to keep things clean.
  2. Declare the bundle in web.xml.
    <context-param>
            <param-name>com.sun.webui.theme.THEME_RESOURCES</param-name>
            <param-value>my.package.woodstock</param-value>
    </context-param>
    Note that you must use the fully qualified name of the properties file (if it is placed in a package).
  3. The Woodstock Theme Doc pages include a list with all the key-value pairs for woodstock messages. You can override these in the new properties file.

1 comment:

anka skakanka said...
This comment has been removed by a blog administrator.