In my model class have the code using anottation of hibernate validator:

@Size(min = 2, message = "Mínimo 2 caracteres")
private String nome;
@Size(min = 5, message = "Mínimo 5 caracteres")
private String descricao;

In my jsp page the message below my input, but I wanted to put this message bootstrap class. how do I handle this message anottation in the css? thank you,

有帮助吗?

解决方案

You can attach a CSS class to the Spring tag that is actually displaying a the error like this:

<sf:errors path="nome" cssClass="errortext" />

Then define .errortext in your CSS file and set your styling from there.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top