Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rest-dev] What do we exactly dislike in Servlet?

Arjan,

 

Servlet *cannot* be slower than Jakarta REST. This sounds like a hoax. Servlet is a very thin layer ontop of existing http servers, while Jakarta REST is a rather huge and complex application framework.

 

In fact, I am not aware of anything that makes me dislike Servlet other than it being obsolete when doing Jakarta REST. In fact I do not see that Jakarta REST would have any benefit from replacing Servlet API by something else, as it is not dependent of the Servlet API (as you know, you can implement and run e. g. Jersey natively on e. g. Grizzly). So from the view angle of Jakarta REST a benefit possibly would be having a thin API that standardizes the native API of Grizzly, Jetty, Netty etc. As Grizzly and Netty are not bound to http, that is not a http api, it is more like a "Streamlet" API. OTOH looking at http/3 merging TCP, TLS and http into a single protocol, it possibly makes sense to actually provide an http api instead of a "Streamlet" API and force Grizzly and Netty TO BECOME "pure" http/3 services in future to gain the performance benefit bound to this mergeā€¦?

 

-Markus

 

Von: rest-dev [mailto:rest-dev-bounces@xxxxxxxxxxx] Im Auftrag von arjan tijms
Gesendet: Dienstag, 12. Juli 2022 21:57
An: jakartaee-platform developer discussions; rest-dev@xxxxxxxxxxx; servlet developer discussions
Betreff: [rest-dev] What do we exactly dislike in Servlet?

 

Hi,

 

The topic came up a couple of times that people/vendors dislike "things" in Servlet, and therefore need to exclude it from their products.

 

For years Servlet was the common way to respond to HTTP requests, but since Servlet is being disliked for some reason, we unfortunately don't have that common HTTP API anymore.

 

Specifically, the Jakarta EE Core profile does not include Servlet support, which leads to various issues such as the one here: https://github.com/eclipse-ee4j/jakartaee-tck/issues/1096

 

In general, I think not having a common HTTP API in Jakarta EE is extremely problematic. Issue 1096 above is only one example of that. It has been discussed in the Servlet spec team before to look at a Servlet-lite profile, but I think we need the input of the other teams to figure out what exactly they dislike so much. If we have a clear list of things that are disliked then those could be potentially excluded from such Servlet-lite profile.

 

One argument I heard is that Servlets are much, much slower than Jakarta REST. But I'm not quite sure why a Java class that implements jakarta.servlet.Servlet should be slower in any way than a Java class with the @Path annotation.

 

Any pointers would be much appreciated.

 

Kind regards,

Arjan Tijms

 

 


Back to the top