*/
public class CustomValidationHandler extends DefaultValidationHandler {
protected void afterValidation(AjaxSubmitEvent event, AjaxResponse response) {
if (event.getValidationErrors() != null && event.getValidationErrors().hasErrors()) {
Component errorImage = new Image(event.getHttpRequest().getContextPath() + "/images/error.gif", "error");
Component errorMessage = new TaggedText(
this.messageSource.getMessage("message.error", null, "Error", LocaleContextHolder.getLocale()),
TaggedText.Tag.SPAN);
AjaxAction removeAction = new RemoveContentAction("onSuccessMessage");
AjaxAction replaceAction = new ReplaceContentAction("onErrorsMessage", errorImage, errorMessage);
AjaxAction effectAction = new Effect("Shake", "onErrorsMessage");