Module jp.ecuacion.splib.web
Package jp.ecuacion.splib.web.exception
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.
- the sorting order of multiple error messages changes each time you run it.
- 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 Summary
ConstructorsConstructorDescriptionConstructs a new instance. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
FormInputValidationException
Constructs a new instance.- Parameters:
form- form
-
-
Method Details
-
getForm
-
setForm
-