lukaszlenart opened a new pull request, #1570: URL: https://github.com/apache/struts/pull/1570
## Summary - Add `struts.ui.checkbox.hiddenPrefix` constant to allow configuring the checkbox hidden field prefix - Default value `__checkbox_` maintains backward compatibility - Addresses HTML validation warnings about double underscores (HTML Tidy) - Users can set `struts_checkbox_` or other prefix for HTML5 compliance Fixes [WW-3429](https://issues.apache.org/jira/browse/WW-3429) ## Changes | File | Change | |------|--------| | `StrutsConstants.java` | Add `STRUTS_UI_CHECKBOX_HIDDEN_PREFIX` constant | | `default.properties` | Add default value `__checkbox_` | | `Checkbox.java` | Inject constant, pass to template | | `CheckboxInterceptor.java` | Inject constant, use in prefix matching | | `simple/checkbox.ftl` | Use `${attributes.hiddenPrefix}` | | `html5/checkbox.ftl` | Use `${attributes.hiddenPrefix}` | | `CheckboxHandler.java` | Get prefix from component parameters | | `CheckboxInterceptorTest.java` | Add tests for configurable prefix | | `CheckboxTest.java` (javatemplates) | Fix test for correct hidden field value | ## Configuration **Default (backward compatible):** No configuration needed - uses `__checkbox_` **HTML5 Compliant:** ```xml <constant name="struts.ui.checkbox.hiddenPrefix" value="struts_checkbox_"/> ``` Or in `struts.properties`: ```properties struts.ui.checkbox.hiddenPrefix=struts_checkbox_ ``` ## Test plan - [x] Run `CheckboxInterceptorTest` - 12 tests pass - [x] Run `CheckboxTest` (core) - 21 tests pass - [x] Run `CheckboxTest` (javatemplates) - 6 tests pass - [ ] Manual verification with showcase app 🤖 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]
