Repository navigation
feat(action-extension): add example for global, package and action extensions - #555
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tensions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd rejection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Adds a new
action-extensionexample module for the per-package / per-actionextensionattribute added in Apache Struts 7.5.0 (WW-4164).struts.action.extension=action/hello.action<package name="legacy" namespace="/legacy" extension="do">/legacy/orders.do<action name="report" extension="">/legacy/reports:url/s:aand print the generated URL. Every link gets the target action's extension, whether it is rendered on a.action,.door extensionless page.legacy/orders.actionandlegacy/report.doare rejected by theactionExtensioninterceptor and render a mappedbad-extensionresult.hello.dois a plain 404.hellodeclares no extension, so it never claims.do.docs/superpowers/.Notes
StrutsJUnit4TestCase.StrutsTestCase.getActionProxydoes not put theActionMappinginto the action context, soactionExtensionlets every request through and a rejection test would pass vacuously.WEB-INF/jsp/. A top-levelindex.jspredirects toindex.action, because the global list has no empty entry and a/indexwelcome file would not map.Test plan
./mvnw -pl action-extension test: 9 tests covering the three mappings,hello.donot mapping, and both rejections./mvnw -B clean package: full reactor BUILD SUCCESSindex.action,legacy/reportandlegacy/orders.do;hello.doreturns 404;orders.action/report.dorender bad-extension; direct JSP access returns 404; the root URL redirects to the index🤖 Generated with Claude Code