feat(inspection): add early DTD validation for Struts config files#66
Merged
lukaszlenart merged 1 commit intomainfrom Apr 5, 2026
Merged
feat(inspection): add early DTD validation for Struts config files#66lukaszlenart merged 1 commit intomainfrom
lukaszlenart merged 1 commit intomainfrom
Conversation
Surface invalid DOCTYPE SYSTEM URIs (http:// instead of https://, or unrecognized URIs) as a file-level warning in Struts2ModelInspection, so users discover the issue while editing struts.xml rather than only when opening the Diagram tab. - Extract StrutsDtdValidator as a shared helper for DTD URI checks - Call the validator from Struts2ModelInspection.checkFileElement() - Add message keys for both http-vs-https and unrecognized DTD warnings - Add StrutsDtdValidatorTest (unit) and highlighting regression test Made-with: Cursor
|
🔌 Plugin artifact ready for testing! Download from Actions artifacts Artifact: |
jogep
approved these changes
Apr 5, 2026
lukaszlenart
added a commit
that referenced
this pull request
Apr 5, 2026
Adds early feedback when a Struts-configured module has no WebFacet, which prevents JSP result path resolution and Diagram navigation. - WebFacetChecker: shared predicate reused by annotator and initializer - StrutsWebFacetCheckingAnnotator: file-level warning on struts.xml with quick action to open module facet settings - StrutsFrameworkInitializer: one-time notification per affected module on project open - Struts2ProjectDescriptorBuilder.withoutWebFacet(): test support for omitting WebFacet in light tests Follow-up to PR #66 (DTD validation). Made-with: Cursor
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StrutsDtdValidatoras a shared helper that checks whether astruts.xmlDOCTYPE SYSTEM URI is valid (recognizedhttps://), useshttp://instead ofhttps://for newer DTDs (2.5+/6.0), or is completely unrecognized.Struts2ModelInspection.checkFileElement()to surface a file-level warning in the editor, so users see the issue while editingstruts.xml— before opening the Diagram tab.StrutsDtdValidatorTestcovering all edge cases (http/https for old and new DTDs, no doctype, unrecognized URI) and a highlighting regression test confirming correcthttps://files produce no warning.Motivation
Users who configure
struts.xmlwith anhttp://DOCTYPE URI for Struts 2.5+ or 6.0 DTDs encounter silent failures: the DOM model doesn't resolve packages, and the Diagram tab appears empty. Previously, this was only flagged via a runtime notification when opening the Diagram tab. This PR moves validation earlier into the standard inspection pipeline.Test plan
StrutsDtdValidatorTest— 8 unit tests for the validation helperStrutsHighlightingTest.testDtdHttpsNoWarning— no false positive on valid DTD./gradlew test -x rat)Made with Cursor