lukaszlenart opened a new pull request, #326: URL: https://github.com/apache/struts-site/pull/326
Companion documentation for [apache/struts#1865](https://github.com/apache/struts/pull/1865), which implements [WW-5695](https://issues.apache.org/jira/browse/WW-5695) (derive HTML5 constraint attributes from validators) and [WW-5694](https://issues.apache.org/jira/browse/WW-5694) (deprecate the generated-JavaScript validator). **Merge this only when #1865 merges** — it documents 7.4.0 behaviour that does not exist yet. ## What changed `core-developers/client-side-validation.md` is largely rewritten. It used to be a short page whose main job was to point at two sub-pages; it is now the primary reference for the feature, covering: - how to enable it (`struts.ui.html5.constraints=true`, off by default, `html5` theme only — there is no per-form `validate="true"` opt-in) - the **never false-reject** rule the mapping is built on, and its most visible consequence: Struts never sets or changes an input `type` - the full validator/attribute mapping table - the three conditions that limit reach in practice, spelled out because they are easy to miss: `required` splitting across two validators that behave differently, `minlength`/`maxlength` and `pattern` both needing `trim="false"` (not the default), and `\s`/`\S` being excluded from the portable-regex allowlist - `data-msg-*` attributes, and the fact that **Struts ships no JavaScript that reads them** - that `requiredLabel` is unrelated to the `required` attribute — a long-standing point of confusion the old page raised but never resolved - the `HtmlConstraintProvider` extension point as the escape hatch for every limitation above `pure-java-script-client-side-validation.md` is deleted and folded into that page as a clearly-marked deprecated section. No internal links to it remain. The `xhtml`, `css_xhtml`, and `form-tag` pages get deprecation notes pointing at the replacement. `ajax-client-side-validation.md` gets one clarifying line: it is unaffected by any of this. ## Accuracy Every claim was checked against the implementation rather than the design doc — the control-type lists come from `HtmlControlType`, and the constant names and defaults from `StrutsConstants` / `default.properties`. The commit history reflects three corrections made when the code and spec diverged during review. ## One open question Deleting `pure-java-script-client-side-validation.md` frees the URL but 404s external inbound links to a page that has existed for years. The site has no redirect plugin and no existing `redirect_from` usage, so I did not invent a pattern. If preserving the URL matters, the cheap fix is to keep the file as a stub pointing at the new anchor — happy to add that. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
