O'Reilly logo

GateIn Cookbook by Piergiorgio Lucidi, Luca Stancapiano, Ken Finnigan

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

Handling different locales in a portlet

According to the JSR 286, Portlet Specification, each portlet manages the internationalization, also called i18n . In this recipe, you will see what WebUI adds to the i18n of a portlet and how the services work.

Getting ready

You need Version 3.2.0 of GateIn working on Tomcat or on JBOSS, the sample application, and two Resource Bundles to test the localization.

How to do it...

Start to add an internationalization sample to an existing project:

  1. Create two Resource Bundles in your sample application. The conventional name of the folder for the Resource Bundle of a portlet is: $APPLICATION_NAME/WEB-INF/classes/locale/portlet/$APPLICATION_NAME/$PORTLET_NAME_xx.properties.

    Write a double APPLICATION_NAME because ...

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