Struts2 validations annotation gives multiple messages -


i using convention plugin. below @validations annotation.

@validations(         requiredfields={@requiredfieldvalidator(type = validatortype.simple, fieldname = "revenue", message = "you must enter value field.")},          intrangefields =                 { @intrangefieldvalidator(type = validatortype.simple, fieldname = "revenue", min = "1", max = "100", message = "id must between 1 100.")},          conversionerrorfields={@conversionerrorfieldvalidator(message="not valid number", type= validatortype.simple, fieldname="id")}         ) 

so when ever giving character instead of number in field test. getting these 3 messages.

invalid field value field "id". not valid number must enter value field. 

instead expecting second or first one. n getting first error. can see have not given such message. how can 1 appropriate message @ time.

regards.

create new file in same package action class defined,.”actionclassname.properties” , in file use “invalid.fieldvalue.fieldname=give msg user”.it working in case working


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -