type=page
status=published
title=Customizing Validator Messages
next=bean-validation-advanced003.html
prev=bean-validation-advanced001.html
~~~~~~
Customizing Validator Messages
==============================

[[GKAHI]]

[[customizing-validator-messages]]
Customizing Validator Messages
------------------------------

Bean Validation includes a resource bundle of default messages for the
built-in constraints. These messages can be customized and can be
localized for non-English-speaking locales.

The following topics are addressed here:

* link:#GKAGY[The ValidationMessages Resource Bundle]

[[GKAGY]]

[[the-validationmessages-resource-bundle]]
The ValidationMessages Resource Bundle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The `ValidationMessages` resource bundle and the locale variants of this
resource bundle contain strings that override the default validation
messages. The `ValidationMessages` resource bundle is typically a
properties file, `ValidationMessages.properties`, in the default package
of an application.

[[GKAIQ]]

[[localizing-validation-messages]]
Localizing Validation Messages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Locale variants of `ValidationMessages.properties` are added by
appending an underscore and the locale prefix to the base name of the
file. For example, the Spanish locale variant resource bundle would be
`ValidationMessages_es.properties`.


