Web dev rookie here, I don't quite understand the common abstractions for servers in the Java world. I sort of understand the concept of servlets, but checking the documentation for Ktor I've read that Ktor can run on a servlet container, like Tomcat. Does that mean Ktor is a servlet itself? Or that implements the servlet interface somewhere, so it can run on Tomcat?
03/20/2021, 4:26 PM
I know nothing about it, but I guess it will register some kind of frontcontroller servlet in case of servlet web containers
thanks @Robert Jaros, that was a nice read. You shared it to complement what I know, right? Or does it answer my question about Ktor? I understand now that there are several acceptable ways to set up a server (http or not) but there are so many tools and concepts it's a bit overwhelming even today.
I've read about different things "X is a servlet that runs on Tomcat" but also "Tomcat is an implementation of the Java Servlet", so... both of them are servlets? Or is there a difference between "servlet *the class*" and "servet the environment/specification/server-of-servlets" or whatever that makes sense? I've always thought the Java world made very poor choices when it comes to terminology, I dunno.
03/20/2021, 8:46 PM
Tomcat is a servlet container - an application. It runs web applications packaged as war archives (a set of java classes). Servlet is a java class - a compiled java or kotlin code. And servlet is also a technology described by Java EE specification.