Skip to main content

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



On Wed, 13 Jul 2022 at 10:48, Joakim Erdfelt <joakim.erdfelt@xxxxxxxxx> wrote:
On Tue, Jul 12, 2022 at 7:10 PM Stuart Douglas <sdouglas@xxxxxxxxxx> wrote:


On Wed, 13 Jul 2022 at 06:21, Joakim Erdfelt <joakim.erdfelt@xxxxxxxxx> wrote:
I think it would make more sense to have an http-core spec.
The basics of serving http as an api.
This means:
  • no sessions
  • no authentication
  • no streaming apis
  • always async (if you want blocking calls, do it yourself.  none of this bolted on broken async that servlet has)
  • no filters (this is just wrappers of the request or the response, and can be genericized)
  • no listeners (pointless specialization, keep it generic)
  • no url-pattern mappings (there's countless ways to map a request to an internal feature, let the users control how they want it)
  • request is an interface (not an abstract class)
  • response is an interface (not an abstract class)
  • no complex war or ear magic
  • no classloader isolation concerns
  • no auto discovery of components
  • no external configuration (xml, json, etc)
  • entirely programmatic
This low level http api would be sufficient to build REST, Servlet, or whatever (grpc?) on top of.
The responsibilities of the http-api impls would be to handle the connections, the exchanges, the http/2+ streams, etc.
Transport concerns, compression, etc.

This is pretty much exactly why we use Vert.x for the core HTTP support in Quarkus, as it provides pretty much everything on this list.

Stuart

This is how Jetty-12 is architected as well.
Core has no servlet, all async, simple, clean.
We support ee8, ee9, and ee10 running at the same time this way too.

Undertow also has the same architecture, and AFAIK grizzly is also the same.

From what I have seen I think Tomcat is the only major implementation that works directly with Servlet objects in the core HTTP layer, although it has been a long time since I looked at the Tomcat code so I may be wrong about this.

Stuart
 

- Joakim
 
_______________________________________________
servlet-dev mailing list
servlet-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/servlet-dev

Back to the top