user509423
user509423

Reputation:

Spring MVC Data binding error

When submitting a form I get the message:

com.xxx.mvc.reports.ReportController: Data binding errors: 6 {||||||| - |}

The command class inherits from an abstract base class.

When using debugging I can see that the values are set on the command class. I use spring 2.5. Somehwere after the fields are set and between the calling of onSubmit in the controller the error occurs. I use a SimpelFormController. The onSubmit method isn't called so I can't inspect the BindException there.

What does this mean and how can I troubleshoot this?

Upvotes: 0

Views: 2140

Answers (2)

Dolfiz
Dolfiz

Reputation: 1062

If you want to easily see every binding error related to your command bean in the page, put something like:

<spring:bind path="command.*">
    <c:forEach items="${status.errorMessages}" var="error">
        <font color="red">Error code: <c:out value="${error}"/></font>
        <br><br>
    </c:forEach>
</spring:bind>

The code is for a bean named "command", as default.

Upvotes: 0

user509423
user509423

Reputation:

I barely posted the question and I found the answer:

<form:errors path="pathName"/>

gives me the errors.

Upvotes: 1

Related Questions