servlet
Mounts a Jakarta HttpServlet at the given path within a Ktor Route.
The servlet is initialized once via init(ServletConfig), as a servlet container would. The config is named after the servlet's class and has no init parameters. Its ServletContext supports attributes and logging, and throws UnsupportedOperationException for container features such as dynamic registration. Each incoming request is translated into a KtorServletRequest/KtorServletResponse pair. The servlet's response headers, status code, and body are then forwarded back through the Ktor response pipeline, with the character encoding the servlet used included in the Content-Type. A content type that does not parse is logged and replaced by application/octet-stream. Content-Length comes from the body actually sent, and the servlet's Content-Length, Transfer-Encoding and Upgrade headers are dropped. Servlet processing runs on kotlinx.coroutines.Dispatchers.IO. The servlet's destroy() is called when the application stops.
Parameters
the URL path at which the servlet should be mounted
the Jakarta servlet instance to handle requests