views:

88

answers:

1

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?

A: 

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.

Eqbal