문제

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