LambdaServlet

class LambdaServlet(contentType: String, block: () -> String) : HttpServlet

An HttpServlet that serves the result of a lambda function as the HTTP GET response body.

Responses include Cache-Control: must-revalidate,no-cache,no-store headers.

Parameters

contentType

the MIME content type for the response. Defaults to "text/plain".

block

a lambda that produces the response body string.

Constructors

Link copied to clipboard
constructor(contentType: String, block: () -> String)
constructor(block: () -> String)

Constructs a LambdaServlet with a default content type of "text/plain".

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open val servletConfig: ServletConfig?
Link copied to clipboard
open val servletContext: ServletContext?
Link copied to clipboard
open val servletInfo: String?
Link copied to clipboard
open val servletName: String?

Functions

Link copied to clipboard
open fun destroy()
Link copied to clipboard
open fun getInitParameter(name: String?): String?
Link copied to clipboard
open fun init()
open fun init(config: ServletConfig?)
Link copied to clipboard
open fun log(msg: String?)
open fun log(message: String?, t: Throwable?)
Link copied to clipboard
open fun service(req: ServletRequest?, res: ServletResponse?)