Skip to content

Continue investigating migration to Jetty 12#2381

Closed
OptimumCode wants to merge 20 commits into
javalin:masterfrom
OptimumCode:jetty-12
Closed

Continue investigating migration to Jetty 12#2381
OptimumCode wants to merge 20 commits into
javalin:masterfrom
OptimumCode:jetty-12

Conversation

@OptimumCode

@OptimumCode OptimumCode commented Mar 14, 2025

Copy link
Copy Markdown

PR continues from where @tipsy stopped. I have managed to make javalin main module compile however, there are several issues that remain:

  • current approach to remove cookie does not work
  • access to upgrade request in web-scokets does not work as before (we cannot get cookies, path, and query params). But for example, if we use org.eclipse.jetty.ee10.servlet.ServletContextRequest.getServletContextRequest(ServletRequest) and then use org.eclipse.jetty.server.CookieCache.getCookies(Request) we can get cookies from upgrade request
  • compression does not work with resources (right now, it is intentional as I did not figure out how to combine compression strategy with jetty resource handler)
  • a few issues related to URI compliance (when multiple slashes are used in request - have not looked closely at this yet)

PR is based on #2158
Relates to #2067

@OptimumCode

Copy link
Copy Markdown
Author

One of the problems is the following issue in jetty: jetty/jetty.project#12913.
Because of that, the resources from a webjar are treated as an alias and 404 is returned instead of the resource

@olindenaus

Copy link
Copy Markdown

Hello @OptimumCode , I would like to ask about the status. Is there something on your list of things left to do (except form the obvious failing checks)? I am thinking to maybe contribute a bit if I could in a way

@OptimumCode

Copy link
Copy Markdown
Author

Hi, @olindenaus, the help would be very welcome) I haven't had much free time recently to continue looking into the PR, unfortunately...

First of all, the new Jetty version was released, and it contains a fix for jetty/jetty.project#12913. We should see fewer failing tests. The rest of the problematic places can be found in the PR description (unfortunately, I have not had time to look closely at all of them). I think the one that causes the most test cases to fail is the cookies problem - the old approach to remove them does not work anymore. The test client (which is reused between tests) keeps cookies from previous tests, and it causes failures.
The second thing is to make compression work with resources. The compression is implemented on the servlet output stream level, but resources are handled by a Jetty-specific handler (which expects different objects as input). I have tried to create a wrapper around the output stream, but it did not work (CompressingResponseWrapper in JettyResourceHandler.kt).

@olindenaus

Copy link
Copy Markdown

Hello @OptimumCode, thanks for your reply, I will try to contribute when I find some free time during these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants