Pregunta

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,

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top