gmantele / vollt

Java libraries implementing the IVOA protocol: ADQL, UWS and TAP
http://cdsportal.u-strasbg.fr/taptuto/
30 stars 29 forks source link

Upgrade UWS to Servlet 5+ #152

Open vforchi opened 9 months ago

vforchi commented 9 months ago

I am trying to upgrade my TAP implementation from Spring Boot 2 to 3.

Among other things, this moves to Jakarta EE (meaning Servlet 6.0, Tomcat 10...)

UWS uses Java EE, preventing this upgrade.

In general, I am not sure why UWS should be aware of HttpServletRequest.

For example: public UWSJob createJob(final HttpServletRequest request, final JobOwner user) could take a map of parameters

And UWSServlet is an abastract class that could be in a separate module. (I am not using it)

gmantele commented 9 months ago

You are also perfectly right. After making TAP-Lib and ADQL-Lib compatible with resp. TAP-1.1 and ADQL-2.1, this is one of my top priority development in my libraries: to decouple HTTP-Servlet API from VOLLT API. This will make much easier the integration in frameworks like Spring and Quarkus while allowing more unitary tests.

vforchi commented 9 months ago

That would be great. I need it only in UWS, because I am not using TapLib. Let me know if I can help.

vforchi commented 9 months ago

How do you plan to do it? Are you going to remove UWSServlet from UWSLib?

gmantele commented 9 months ago

No, existing servlets will still exist. But I intent to make all other classes independent from the Servlet API. Existing servlets in UWSLib will then be adapted to use the other updated classes.

vforchi commented 9 months ago

but if you keep the servlet in the module how can you decouple it from the old servlet API?

gmantele commented 9 months ago

The servlet will still exist for backward compatibility and it will still use the servlet API. There will some kind of adapter transforming Servlet parameters into the new UWSLib parameters. Not sure it is clear. Anyway, existing servlets may be provided in a UWSLib extension

jontxu commented 9 months ago

Sorry for chiming in, but I mentioned this a while ago at #133. It happened after installing tomcat 10 and trying to deploy VOLLT. There is indeed a tool which adapts the old servlets API (Java EE) to the new one (Jakarta EE) for backwards compatibility: https://github.com/apache/tomcat-jakartaee-migration

gmantele commented 9 months ago

Hi @jontxu , thank you for the info and remembering me about this other issue.