O'Reilly logo

IBM Rational Application Developer V6 Portlet Application Development and Portal Tools by Ryan Wilson, Gianfranco Rutigliano, George Kroner, Belen Gonzalez, Karla Galvan, Cristiano Cesario, Juan R. Rodriguez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.3. JSR 168 API considerations

In this section you will see how to access resource bundles in Portlets JSR 168, from JSPs and from portlets.

If you want to access resource bundles in JSPs, you have to use the JSP tag library as we explained in “Accessing resource bundles in JSPs” on page 382.

To access resource bundles in Portlets JSR 168 use getResourceBundle(java.util.Locale) method of javax.portlet.GenericPortlet class as displayed in Example 12-8

Example 12-8. Accessing resource bundles in Portlets JSR 168
ResourceBundle resource =
      getPortletConfig().getResourceBundle(request.getLocale());
String valor = resource.getString("welcome");

The name of the resource bundles where the information is stored is provided by the portlet deployment ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required