It'd be nice to have a way for specifying a single field to report {{@ScriptAssert}} constraint violations against (instead of the entire bean).
{code} @ScriptAssert(lang = "javascript", script = "_this.endDate.after(_this.startDate)", reportOn="endDate") public class CalendarEvent {
private Date startDate; private Date endDate;
//... } {code}
From http://www.bmchild.com/2013/06/use-scriptassert-logic-with-field-error.html. |
|