Is there a way to get a variable in to a custom ConstraintValidator when using JAX-RS?
问题 When de-serializing a JSON payload i want to validate a phone number using a custom validator. This validator needs to know what country the customer is in to correctly parse the phone number. The country i can find in the http header Accept-Language. The problem is how can i provide the custom validator with this extra meta data? I was sure that @Context would inject the HttpHeaders into the PhoneNumberValidator but this does not work: @Context private HttpHeaders mHttpHeaders; The field is