java - Diffrent validation message from javax @Pattern -
my class user has 2 fields phones, 1 mobile phone , second work phone.
@valid @notnull @jsonview({view.detail.class}) private phone workphone; @valid @jsonview({view.detail.class}) private phone mobilephone;
class phone has field number validated @pattern
@jsonview({view.country.class, view.detail.class, view.summary.class}) @notblank(message = "missing.phone") @pattern(regexp = regexps.only_digits, message = profilemessages.mobile_phone_invalid) @length(max = 25, message = commonmessages.length_max) private string number;
my problem message attribute of @pattern profilemessages.mobile_phone_invalid right mobile phone. there way dynamically change message without example creating new classes? when tried adding new field , using message filler shows me error should constant value.
Comments
Post a Comment