on 07-30-2014 4:42 PM
Hi all,
I am trying to apply Pattern constraint to an integer type through adminCockpit validation engine. I have used the ^[0-9]{1,5}$ regex to allow only numbers with in the mentioned range. I have reloaded the validation engine after creating the constraint. But getting an error as "No validator could be found for type: java.lang...", while i try to check the validation result for the specified attribute in Product Cockpit editor area.
Please help me out on this issue. Please find the attached screenshots for reference.
Thanks in advance
Regards,
You could check if the pattern validator works on a string field. If it does it is not applicable for integer and you might need to reimplement it for integer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have very similar Problem. Getting "javax.validation.UnexpectedTypeException: HV000030: No validator could be found for type: java.lang.String."
The type I want to proofe is a localized String.
@Target({ TYPE })
@Retention(RUNTIME)
@Constraint(validatedBy = YYYValidator.class)
@Documented
public @interface YYYConstraint {
String message() default " {...YYYConstraint.message}";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
String qualifier();
}
And the Validator looks line that:
public class YYYValidator implements ConstraintValidator<YYYConstraint, ItemModel> {
private String attribute;
@Override
public void initialize(YYYConstraint yyyConstraint) {
attribute = yyyConstraint.qualifier();
}
@Override
public boolean isValid(ItemModel itemModel, ConstraintValidatorContext constraintValidatorContext) {...}
Where do I have to specify the Type here in my Code??
Greatings David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.