This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch feature/WW-5695-html5-constraint-validation in repository https://gitbox.apache.org/repos/asf/struts.git
commit 81db2b2a59dc0d01371d464890c15adb1fa12f5c Author: Lukasz Lenart <[email protected]> AuthorDate: Mon Aug 24 19:36:50 2026 +0200 WW-5694 refactor(validation): deprecate JavaScript client-side validation Marks the form tag's validate attribute and the machinery behind it for removal in 8.0.0. Annotations and documentation only; no behaviour change. Follows the WW-5510 precedent: annotate both the component and the JSP tag, and put the notice inside the START SNIPPET block so the website picks it up. Co-Authored-By: Claude Opus 5 <[email protected]> --- core/src/main/java/org/apache/struts2/components/Form.java | 4 ++++ core/src/main/java/org/apache/struts2/views/jsp/ui/FormTag.java | 1 + core/src/main/resources/template/xhtml/form-close-validate.ftl | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/core/src/main/java/org/apache/struts2/components/Form.java b/core/src/main/java/org/apache/struts2/components/Form.java index 7db1477c3..250c9b57d 100644 --- a/core/src/main/java/org/apache/struts2/components/Form.java +++ b/core/src/main/java/org/apache/struts2/components/Form.java @@ -48,6 +48,7 @@ import java.util.Set; /** * <!-- START SNIPPET: javadoc --> + * <strong>Deprecated since 7.4.0 — use the html5 theme's constraint attributes instead. Removed in 8.0.0.</strong> * <p> * Renders HTML an input form. * </p> @@ -239,6 +240,7 @@ public class Form extends ClosingUIBean { * @param namespace the namespace to check for * @param actionMethod the method to ckeck for */ + @Deprecated(since = "7.4.0", forRemoval = true) protected void evaluateClientSideJsEnablement(String actionName, String namespace, String actionMethod) { // Only evaluate if Client-Side js is to be enable when validate=true @@ -268,6 +270,7 @@ public class Form extends ClosingUIBean { } } + @Deprecated(since = "7.4.0", forRemoval = true) public List getValidators(String name) { Class actionClass = (Class) getAttributes().get("actionClass"); if (actionClass == null) { @@ -509,6 +512,7 @@ public class Form extends ClosingUIBean { @StrutsTagAttribute(description = "Whether client side/remote validation should be performed. Only" + " useful with theme xhtml/ajax", type = "Boolean", defaultValue = "false") + @Deprecated(since = "7.4.0", forRemoval = true) public void setValidate(String validate) { this.validate = validate; } diff --git a/core/src/main/java/org/apache/struts2/views/jsp/ui/FormTag.java b/core/src/main/java/org/apache/struts2/views/jsp/ui/FormTag.java index 3bdb48379..083537798 100644 --- a/core/src/main/java/org/apache/struts2/views/jsp/ui/FormTag.java +++ b/core/src/main/java/org/apache/struts2/views/jsp/ui/FormTag.java @@ -93,6 +93,7 @@ public class FormTag extends AbstractClosingTag { this.namespace = namespace; } + @Deprecated(since = "7.4.0", forRemoval = true) public void setValidate(String validate) { this.validate = validate; } diff --git a/core/src/main/resources/template/xhtml/form-close-validate.ftl b/core/src/main/resources/template/xhtml/form-close-validate.ftl index 8e8661568..a815105a1 100644 --- a/core/src/main/resources/template/xhtml/form-close-validate.ftl +++ b/core/src/main/resources/template/xhtml/form-close-validate.ftl @@ -19,6 +19,13 @@ */ --> <#-- +DEPRECATED since Struts 7.4.0, removed in 8.0.0 (WW-5694 / WW-5696). + +JavaScript client-side validation is superseded by native HTML5 constraint +attributes in the html5 theme (WW-5695). This template, form-validate.ftl and +validation.js are all removed in 8.0.0. +--> +<#-- START SNIPPET: supported-validators Only the following validators are supported: * required validator
