jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
https://eclipse.dev/jetty
Other
3.86k stars 1.91k forks source link

javax.servlet-api not found jetty #12474

Closed sahil3390 closed 1 week ago

sahil3390 commented 1 week ago

Hi Team,

We have a question regarding the Jetty 3PP used in our product. Currently, we are using Jetty version 9.4.56, which depends on javax.servlet-api-3.1.jar. However, as stated on the Jetty 3PP homepage, we downloaded the package from the link "https://github.com/jetty/jetty.project/releases/tag/jetty-9.4.56.v20240826" but could not find the javax.servlet-api-3.1.jar file in the downloaded package.

Could you clarify why javax.servlet-api-3.1.jar is not included in the Jetty package if Jetty v9.4.56 relies on it?

We look forward to your prompt response.

sbordet commented 1 week ago

@sahil3390 Jetty 9.4.x is at end of community support, see:

Please upgrade to Jetty 12.

FTR. the javax.servlet classes are present, just in a different jar.

sahil3390 commented 1 week ago

Thanks for the quick support.

Can please mention in which jar we can find the javax.servlet classes, i tried search in the source but unable to find it.

olamy commented 1 week ago

You can download javax.servlet classes from https://repo.maven.apache.org/maven2/javax/servlet/javax.servlet-api/

sahil3390 commented 1 week ago

Does this mean that we need to download javax.servlet-api compatible version with jetty 9.4.56 separately from: https://repo.maven.apache.org/maven2/javax/servlet/javax.servlet-api/ and it is not part of the jetty.project-jetty-9.4.56.v20240826.tar.gz present on github?

olamy commented 1 week ago

As far as I can see it's part of the jetty-distribution


olamy@pop-os:~/dev/sources/jetty/jetty.project/target$  unzip -l jetty-distribution-9.4.56.v20240826.zip | grep servlet-api
    95806  2024-08-26 13:21   jetty-distribution-9.4.56.v20240826/lib/servlet-api-3.1.jar
sahil3390 commented 1 week ago

if i am not wrong jetty-distribution is part of jetty.project-jetty-9.4.56, right?

sbordet commented 1 week ago

@sahil3390 the package you downloaded from GitHub is the Jetty source code, which does not produce the Servlet APIs.

The jetty-home artifact that you can download from Maven Central contains the Servlet API jar.

Update to Jetty 12 and read the documentation: https://jetty.org/docs/jetty/12/operations-guide/begin/index.html