Frage

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,

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top