ktor-server-servlet / io.ktor.server.servlet / KtorServlet

KtorServlet

abstract class KtorServlet : HttpServlet, CoroutineScope

A base class for servlet engine implementations

Constructors

<init>

KtorServlet()

A base class for servlet engine implementations

Properties

application

abstract val application: Application

Current application instance. Could be lazy

coroutineContext

open val coroutineContext: <ERROR CLASS>

enginePipeline

abstract val enginePipeline: EnginePipeline

Engine pipeline

logger

open val logger: Logger

Application logger

upgrade

abstract val upgrade: ServletUpgrade

Servlet upgrade implementation

Functions

destroy

open fun destroy(): Unit

Called by servlet container when the application is going to be undeployed or stopped.

init

open fun init(): Unit

Called by the servlet container when loading the servlet (on load)

service

open fun service(request: HttpServletRequest, response: HttpServletResponse): Unit

Called by the servlet container when an HTTP request received.

Inheritors

ServletApplicationEngine

open class ServletApplicationEngine : KtorServlet

This servlet need to be installed into a servlet container