How i put css on message of Hibernate validator anotation message of spring project


Tags: java,css,spring,twitter-bootstrap,hibernate-validator

Problem :

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,



Solution :

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.


    CSS Howto..

    CSS how to align vertically center div floating elements of menu?

    How to set css via jquery for preventing some action

    How not to use body style css rule in part of html code?

    how to define multiple classes' hover event in css?

    How to size this text with css?

    How do you square off only one corner of a div to be transparent in CSS?

    CSS: How to get browser scrollbar width? (for :hover {overflow: auto} nice margins)

    Best practice: how to name css default state? [closed]

    A really simple question: How to apply a style to an iframe whose parent tag's id is known?

    Show another element with hover

    How to move a span after an img?

    How can I layout a sidebar or pullquote?

    How to combine Background Image and CSS Gradient

    How to make circle thing in CSS? [duplicate]

    How to make border for UL if Li has style “float:left;”?

    CSS question - transparent underlined textbox - howto?

    How to put a banner above the fixed navbar of bootstrap which disappears when scrolling down?

    How can I mark it up? [closed]

    How to style an image created using javaScript

    How to make div width almost 100%

    how to position heading in the center of the page

    How to rearrange these elements with CSS?

    CSS - how to dry up?

    How is physical inch related to pixels in css given so many different resolutions?

    CSS How to Make Image Display outside of div

    Jquery: how to get menu to expand towards the right instead of the left

    How can I make clickable list with sublinks ?

    How to move hamburger menu to the front of overlay menu

    How to show the scaled image and text in the view port without scrollbar?

    How to align this text in CSS?