Example #1
0
  /**
   * Robbed from {@link FormComponent}
   *
   * @param e
   * @param error
   */
  private void reportValidationError(ConversionException e, ValidationError error) {
    final Locale locale = e.getLocale();
    if (locale != null) {
      error.setVariable("locale", locale);
    }
    error.setVariable("exception", e);
    Format format = e.getFormat();
    if (format instanceof SimpleDateFormat) {
      error.setVariable("format", ((SimpleDateFormat) format).toLocalizedPattern());
    }

    Map<String, Object> variables = e.getVariables();
    if (variables != null) {
      error.getVariables().putAll(variables);
    }

    error((IValidationError) error);
  }