Hi,

I have an application which is built on top of Tomcat, currently 10.1.

The part of the application that interfaces with Tomcat is a single custom 
class that extends jakarta.servlet.GenericServlet[1]:

This servlet implements the abstract void "service" method, which
1. reads the request headers, parameters and parts (for multipart requests),
2. does the request processing (through delegated web and business logic 
layers),
3. sets some headers on (Http)ServletResponse and
4. fills the OutputStream of the (Http)ServletResponse.

The application does not use JSP, EL, no filters, ... The web.xml consists of 1 
Servlet definition and 1 Servlet mapping.
The rest of the application is decoupled from the web container technology and 
doesn't know anything from jakarta.servlet.*.

Therefore, I could maybe even switch to NanoHTTPD.[2]

But I love Tomcat being so *perfectly maintained*, proven and reliable! <3 
THANKS SO MUCH!
And Tomcat offers HTTP/1.1 and HTTP/2 Connectors while NanoHTTPD seems to lack 
HTTP/2 support.

But as so much of Tomcat is not used in this specific application, I thought if 
I could build a "shortcut" to reduce the parts involved in request processing 
and speed up reaction times.
Something like building a web app on top of a "light" Tomcat skeleton, with 
only a few stacktrace lines involved for a request to be processed.
From a first look, the Engine component / interface might be a starting point?
And amazingly, with Tomcat we're free to configure custom implementation 
classes for lots of components, e.g. Engine.[3]
So such an approach wouldn't mean to build a horribly to maintain fork with 
custom patches against Tomcat's source tree.

Are you aware if someone did something like the devised "light" container 
before?

Yours,
Reg

[1] 
https://jakarta.ee/specifications/servlet/4.0/apidocs/javax/servlet/genericservlet
[2] https://github.com/NanoHttpd/nanohttpd
[3] 
https://tomcat.apache.org/tomcat-10.1-doc/config/engine.html#Common_Attributes


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to