Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jetty-12 ee9 contextPath not set correctly on nested ContextHandler #9785

Closed
janbartel opened this issue May 18, 2023 · 1 comment
Closed
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@janbartel
Copy link
Contributor

The deployer tries to set a default context path when it deploys a webapp. In the case of ee9, the webapp will be an instanced of the nested/ContextHandler, which is a Supplier<ContextHandler> ie a supplier of core ContextHandler. The deployer gets the core ContextHandler and calls setContextPath(String) on it. Unfortunately, it is only in the nested/ContextHandler.setContextPath(String) method (which is not called) where we set up the _contextPathEncoded. It is the _contextPathEncoded that the Request uses. Thus, it appears as if the webapp is deployed correctly at the default context path, but any code that uses Request.getContextPath() will return null. We see this with the tck form security tests, where the redirect to the /login.jsp page is missing the _contextPathEncoded prefix.

@janbartel
Copy link
Contributor Author

Fixed via #9786

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

1 participant