This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch docs/struts-7.3.0-content-audit in repository https://gitbox.apache.org/repos/asf/struts-site.git
commit 16d3297f57e3b42bfb7c62dacef6201b7f8c30b5 Author: Lukasz Lenart <[email protected]> AuthorDate: Mon Aug 3 07:30:12 2026 +0200 docs: document struts.validators.skipValidatorsOnConversionError WW-2934: an opt-in constant (default false) that skips a field's remaining validators once that field has a type conversion error, so the user no longer sees both a conversion error and a redundant validator error. The conversion field validator itself is never skipped. Co-Authored-By: Claude Opus 5 <[email protected]> --- source/core-developers/validation.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/core-developers/validation.md b/source/core-developers/validation.md index 4ce33c2bc..ff2eb799a 100644 --- a/source/core-developers/validation.md +++ b/source/core-developers/validation.md @@ -516,6 +516,27 @@ both validators will be run, even if the "required" validator short-circuits. "r and will not short-circuit the plain ExpressionValidator because FieldValidators only short-circuit other checks on that same field. Since the plain Validator is not field specific, it is not short-circuited. +## Skipping Validators on a Conversion Error + +> Since Struts 7.3.0 + +When a field fails [type conversion](type-conversion) — a user typing `one` into an `Integer age` field, for example — +the [Conversion Error Interceptor](conversion-error-interceptor) records a conversion error before the validators run. +The field's own validators then run against a value the user never entered, so a `requiredstring` or `int` validator +typically adds a second, redundant error for the same field. + +Set the following constant to skip a field's remaining validators once that field has a conversion error: + +```xml +<struts> + <constant name="struts.validators.skipValidatorsOnConversionError" value="true"/> +</struts> +``` + +The default is `false`, which preserves the long-standing behaviour of reporting both errors. The `conversion` field +validator itself is never skipped, so a custom conversion message and the `repopulateField` behaviour of +[Conversion Validator](conversion-validator) keep working. Action-level (non-field) validators are unaffected. + ## How Validators of an Action are Found As mentioned above, the framework will also search up the inheritance tree of the action to find default validations
