O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

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

Supporting I18N for validation messages

The PrimeFaces CSV framework displays conversion or validation errors in the same way as the JSF server-side conversion or validation error messages, and also supports Internationalization (I18N). You can find more information on Internationalization in the Understanding Internationalization (I18N) and Localization (L10N) section of Chapter 7, Introducing Advanced Input Components.

You can have error messages in ResourceBundles that are registered in the faces-config.xml file and use them for validation or conversion messages as follows:

<p:inputText id="email" value="#{userController.registerUser.emailId}" label="EmailId" 
    required="true" validatorMessage="#{msg['invalid.email']}"> <f:validateRegex pattern="^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" ...

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