JinwooHwang commented on code in PR #7940:
URL: https://github.com/apache/geode/pull/7940#discussion_r2442518777
##########
geode-http-service/src/main/java/org/apache/geode/internal/cache/http/service/InternalHttpService.java:
##########
@@ -64,18 +82,77 @@ public class InternalHttpService implements HttpService {
private final List<WebAppContext> webApps = new ArrayList<>();
+ /**
+ * Bridges WebAppContext and ServletContext attribute namespaces in Jetty 12.
+ *
+ * <p>
+ * Why needed: In Jetty 12, WebAppContext.setAttribute() stores attributes
in the webapp's
+ * context, but Spring's ServletContextAware beans (like
LoginHandlerInterceptor) retrieve
+ * from ServletContext.getAttribute(). These are separate namespaces that
don't auto-sync.
+ *
+ * <p>
+ * Timing: contextInitialized() is invoked BEFORE Spring's DispatcherServlet
initializes,
+ * guaranteeing attributes are present when Spring beans request them during
dependency injection.
+ * Without this, SecurityService would be null in LoginHandlerInterceptor,
causing 503 errors.
+ */
+ private static class ServletContextAttributeListener implements
ServletContextListener {
Review Comment:
Thank you @sboorlagadda
--
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]