I am using GF4 with bean validation. I am trying to @Inject
a service bean in my custom validator but I get a null
value.
public class TestValidator implements ConstraintValidator<>{
@Inject Service myService;
}
Isn't this suppose to be working with JEE7?
Also, I am trying to find built-in dynamic message interpolation (Without writing my own MessageInterpolator
). I did see some examples but they are not very clear. What I am looking for is to pass dynamic parameters from the ConstraintValidator.isValid
. For example:
Message_test={value} is not valid
And somehow weave this, in the same way that you can statically interpolate the Annotation
values e.g. size_msg={min}-{max} is out of range.