You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@struts.apache.org by "lukaszlenart (via GitHub)" <gi...@apache.org> on 2026/02/06 14:45:09 UTC

[PR] WW-3429 Add configurable checkbox hidden field prefix [struts]

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: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WW-3429 Add configurable checkbox hidden field prefix [struts]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1570:
URL: https://github.com/apache/struts/pull/1570#issuecomment-3860886028

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1570) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1570&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1570&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1570&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1570&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1570&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1570)
   
   


-- 
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: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WW-3429 Add configurable checkbox hidden field prefix [struts]

Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart merged PR #1570:
URL: https://github.com/apache/struts/pull/1570


-- 
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: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org