throw new RuntimeException(ex);
}
heartbeat.end();
ValidationTracker tracker = _environment.peek(ValidationTracker.class);
// Let the listeners peform any final validations
// Update through the parameter because the tracker has almost certainly changed
// internal state.
_tracker = tracker;
_resources.triggerEvent(VALIDATE, context, handler);
if (holder.hasValue()) return holder.get();
_formSupport.executeDeferred();
// Let the listeners know about overall success or failure. Most listeners fall into
// one of those two camps.
// If the tracker has no errors, then clear it of any input values
// as well, so that the next page render will be "clean" and show
// true persistent data, not value from the previous form submission.
if (!_tracker.getHasErrors()) _tracker.clear();
_resources.triggerEvent(tracker.getHasErrors() ? FAILURE : SUCCESS, context, handler);
// Lastly, tell anyone whose interested that the form is completely submitted.
if (holder.hasValue()) return holder.get();