O'Reilly logo

JSF 2.0 Cookbook by Anghel Leonard

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

Customizing error messages for validators

The error messages that are shown for each type of validation error are controlled by the Message.properties file, which is located in the javax.faces package of jsf-api.jar. You can customize/replace these error messages with your own or you can add new messages. Also, you can provide messages in different languages, not just in English. In this recipe, we will customize error messages using three scenarios, as follows:

  • Customizing the default messages from Message.properties
  • Creating our own error messages
  • Generating error messages from custom converters

Getting ready

We developed this recipe with NetBeans 6.8, JSF 2.0, and GlassFish v3. The JSF 2.0 classes were obtained from the NetBeans JSF 2.0 bundled ...

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