In Spring MVC validation, Is it possible to show only one error message per field at a time?

前端 未结 3 1057
礼貌的吻别
礼貌的吻别 2020-12-15 12:03

Example,

I have

@NotEmpty //tells you \'may not be empty\' if the field is empty
@Length(min = 2, max = 35) //tells you \'length must be between 2 an         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-15 12:55

    A better solution would be to have some markup in your error message so that it formats nicely, such as a
    , and use a CSS class to format the overall message. As noted in Bozho's comment, a user should be aware of everything that is incorrect.

提交回复
热议问题