Prefer dispatcher context for authorize tag beans#18822
Merged
jzheaux merged 2 commits intospring-projects:mainfrom Mar 20, 2026
Merged
Prefer dispatcher context for authorize tag beans#18822jzheaux merged 2 commits intospring-projects:mainfrom
jzheaux merged 2 commits intospring-projects:mainfrom
Conversation
Signed-off-by: wonderfulrosemari <whwlsgur1419@naver.com>
jzheaux
requested changes
Mar 5, 2026
Contributor
jzheaux
left a comment
There was a problem hiding this comment.
Thanks, @wonderfulrosemari, for the PR! I've left feedback inline.
taglibs/src/main/java/org/springframework/security/taglibs/authz/AbstractAuthorizeTag.java
Outdated
Show resolved
Hide resolved
taglibs/src/main/java/org/springframework/security/taglibs/authz/AbstractAuthorizeTag.java
Outdated
Show resolved
Hide resolved
taglibs/src/main/java/org/springframework/security/taglibs/authz/AbstractAuthorizeTag.java
Outdated
Show resolved
Hide resolved
taglibs/src/main/java/org/springframework/security/taglibs/authz/AbstractAuthorizeTag.java
Outdated
Show resolved
Hide resolved
taglibs/src/test/java/org/springframework/security/taglibs/authz/AbstractAuthorizeTagTests.java
Outdated
Show resolved
Hide resolved
taglibs/src/test/java/org/springframework/security/taglibs/authz/AbstractAuthorizeTagTests.java
Show resolved
Hide resolved
taglibs/src/test/java/org/springframework/security/taglibs/authz/AbstractAuthorizeTagTests.java
Show resolved
Hide resolved
taglibs/src/test/java/org/springframework/security/taglibs/authz/AbstractAuthorizeTagTests.java
Outdated
Show resolved
Hide resolved
Contributor
|
@wonderfulrosemari thank you again for the PR. I've applied the updates from my review; this PR will merge once the build completes. |
Closes spring-projectsgh-8843 Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
d0b0ea1 to
830bba9
Compare
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.
Closes gh-8843
When both root and child web application contexts are present, JSP authorize
tags should resolve security beans from the DispatcherServlet context used for
the current request.
Previously,
AbstractAuthorizeTagalways resolved beans fromfindRequiredWebApplicationContext(servletContext), which prefers the rootcontext. If security beans were defined only in the child context, this could
cause failures like missing
WebSecurityExpressionHandler.Changes include:
context attribute when available
SecurityWebApplicationContextUtils.findRequiredWebApplicationContextwhen no dispatcher context is present
<sec:authorize>expression evaluation succeeds