How to restrict a user to enter Integer value using Annotations?
I am trying some field validations using annotations like @Regexp,
@Notnull,@NotBlank etc.I use a message.property file to display my error
messages like
MerchantView.merchantPosId[not.blank]=Please enter merchant pos id's
MerchantView.merchantPosId[regexp]=Please enter merchant pos id's in comma
separated numbers MerchantView.merchantPosId[length]=Please do not enter
more than 100 Characters. MerchantView.accountNumber[not.null]=Please
enter merchant account number.
I am able to do all the field validation with a string field or when a
field is empty(even for long and integer fields).
But i am unable to populate any custom message for my Integer or Long
field when any other data type is entered.What kind of annotations do i
need to use.Thanks
No comments:
Post a Comment