Alex Rivera | Logout

Spring validation @AssertTrue

Asked 2010-05-18T00:08:24.183
15

How do I display on a view jsp validation error message that occurs as a result of @AssertTrue annotation? It isn't tied to a specific field, but I am using it to validate a combination of fields. If I use <form:errors path="*"/> that will display all the errors for that form?

Edit
Report

1 Answer

10

Declaring a boolean property is what seems to work for this. So if there is:

@AssertTrue
public boolean isConditionTrue() {
   ...
   ...
}

then declaring a property like:

private boolean conditionTrue;

works.

answered 2010-05-19T00:45:25.957

Your Answer