Class FormInputValidationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
jp.ecuacion.lib.core.exception.checked.AppException
jp.ecuacion.splib.web.exception.FormInputValidationException
All Implemented Interfaces:
Serializable

public class FormInputValidationException extends jp.ecuacion.lib.core.exception.checked.AppException
Throws FormInputValidationException.

This method validates the form again to get the appropriate messages.

Originally, I would have left it to spring mvc's validation, but the following two points are not acceptable.

  1. the sorting order of multiple error messages changes each time you run it.
  2. Validations such as @Size are not defined to ignore blank, so validations such as @Size will return "false" even if the value is blank and @NotEmpty is set to the variable.

About 1, spring mvc standard validation error messages are obtained from #fields.errors at thymeleaf. I tried to sort the list from java, bindingResult.getFieldErrors() is unmodifiable.

See Also:
  • Constructor Details

    • FormInputValidationException

      public FormInputValidationException(SplibGeneralForm form)
      Constructs a new instance.
      Parameters:
      form - form
  • Method Details