I have correctly setup Hibernate Validator in Spring MVC application. Beans are validated, but I have trouble displaying errors.
In my JSP page I have following line:
<sf:errors path="*" cssClass="errors" element="div" />
When I run page and inspect it with chrome’s inspector, there is no div (or any) element for holding those errors. It’s completely ignored. That’s weird, because following line is correctly resolved to html form in same JSP:
<sf:form method="post" modelAttribute="tsCommand">
Here’s taglib I use for spring forms:
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
Any ideas what might have gone wrong?
Your syntax is correct, I’m not sure about the “element=\”div\”” attribute.
Your controller must seem like that:
And your context:
Woth this, it’ll gonna be Ok 😉