title: How can I customize the Validator for Hibernate Validator's method validation with Seam?
body: <p>I'm using Hibernate Validator and added some custom validation annotations, resource bundle location and a custom message interpolator. This is all done by customizing the Validator at bootstrapping time.</p>
  
  <p>Now I'm trying to validate methods, but of course I don't get my nicely configured Validator, since the standard Validator is injected for <code>@AutoValidating</code>.</p>
  
  <p>How can I customize the Validator within Seam Validation?</p>
  
  <hr>
  
  <p>Here's how I create the Validator:</p>
  
  <pre><code>public static javax.validation.Validator getBeanValidator(final Locale locale,
      final ResourceBundle... resourceBundles) {
    HibernateValidatorConfiguration configuration = Validation.byProvider(HibernateValidator.class).configure();
    FallbackResourceBundleLocator resourceBundleLocator = new FallbackResourceBundleLocator(
        configuration.getDefaultResourceBundleLocator(), resourceBundles);
    configuration.messageInterpolator(new FieldMessageInterpolator(locale, resourceBundleLocator));
    javax.validation.ValidatorFactory validatorFactory = configuration.buildValidatorFactory();
    return validatorFactory.getValidator();
  }
  </code></pre>