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

Upgrade to Jakarta EE #624

Open
gkresic opened this issue Feb 5, 2023 · 6 comments
Open

Upgrade to Jakarta EE #624

gkresic opened this issue Feb 5, 2023 · 6 comments

Comments

@gkresic
Copy link
Contributor

gkresic commented Feb 5, 2023

This is an extension to #490 (first half of it, anyway). Over there it was proposed to to upgrade to servlet 4 spec, but nothing is said on javax -> jakarta namespace migration that is part of spec 4.

So I propose migration in 2 steps:

  1. migrate to Servlet 4 spec, but keep javax.servlet namespace
  2. switch namespace to jakarta.servlet (this will imply switching implementations, but all currently supported implementations supports this in parallel releases: Jetty 10/11, Tomcat 9/10 and Undertow with io.undertow:undertow-servlet-jakartaee9 dependency

If Pippo doesn't have to support parallel versions for JavaEE and JakartaEE, then those two steps could be squashed into one and leave JavaEE compatibility behind.

Depends on #613

@gkresic
Copy link
Contributor Author

gkresic commented Feb 14, 2023

I may submit a pull request for this one, but would like first to clarify the strategy for getting there among the two described above.

Since Pippo 1.x supports javax namespace, it's stable and can be used in legacy apps as is, my suggestion would be to go with Pippo 2.x straight to jakarta namespace.

@decebals
Copy link
Member

my suggestion would be to go with Pippo 2.x straight to jakarta namespace

I agree.

@gkresic
Copy link
Contributor Author

gkresic commented Feb 16, 2023

Working on it and I'm almost done, but have one question.

Due to the changes in the way Jetty handles WebSockets, I need an access to Jetty Server instance from within JettyWebSocketFilter.init

What would be the best was to access it from there? Provided FilterConfig does not hold any reference to Server.

@gkresic
Copy link
Contributor Author

gkresic commented Feb 17, 2023

Here's my work so far:

https://github.com/gkresic/pippo/tree/jakarta

Notice hardcoded server access in ro.pippo.jetty.websocket.JettyWebSocketFilter: https://github.com/gkresic/pippo/blob/jakarta/pippo-server-parent/pippo-jetty/src/main/java/ro/pippo/jetty/websocket/JettyWebSocketFilter.java

Tests confirm that WebSocket endpoints are working.

Unrelated, notice that my initial assumptions about servlet versions were incorrect: servlet specs 4 and 5 are the same, only difference being javax/jakarta namespace difference. So this, when implemented will move Pippo to servlet version 5 spec. Version 6 will have to wait until Jetty 12 (currently in alpha) since it's the only server of three (Jetty/Tomcat/Undertow) that doesn't support v6.

@decebals
Copy link
Member

@gkresic When you have something functional please create a PR fore review and comments. It's more easy to compare the impact of the changes using the diffs view.

@gkresic
Copy link
Contributor Author

gkresic commented Feb 21, 2023

Created WIP PR #639

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

No branches or pull requests

2 participants