Package org.springframework.web.servlet.function

Types

Link copied to clipboard
class RouterFunctionDsl

Provide a WebMvc.fn RouterFunction Kotlin DSL created by router { } in order to be able to write idiomatic Kotlin code.

Functions

Link copied to clipboard
fun ServerRequest.attributeOrNull(name: String): Any?

Nullable variant of ServerRequest.attribute

Link copied to clipboard
inline fun <T : Any> ServerRequest.body(): T

Extension for ServerRequest.body providing a body<Foo>() variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Link copied to clipboard
inline fun <T : Any> ServerResponse.BodyBuilder.bodyWithType(body: T): ServerResponse

Extension for ServerResponse.BodyBuilder.body providing a variant leveraging Kotlin reified type parameters.

Link copied to clipboard
fun ServerRequest.Headers.contentLengthOrNull(): Long?
Link copied to clipboard
fun ServerRequest.Headers.contentTypeOrNull(): MediaType?
Link copied to clipboard
fun ServerRequest.paramOrNull(name: String): String?

Nullable variant of ServerRequest.param

Link copied to clipboard
operator fun <T : ServerResponse> RouterFunction<T>.plus(other: RouterFunction<T>): RouterFunction<T>

Equivalent to RouterFunction.and.

Link copied to clipboard
fun ServerRequest.principalOrNull(): Principal?

Nullable variant of ServerRequest.param

Link copied to clipboard
fun ServerRequest.remoteAddressOrNull(): InetSocketAddress?

Nullable variant of ServerRequest.remoteAddress

Link copied to clipboard
fun router(routes: RouterFunctionDsl.() -> Unit): RouterFunction<ServerResponse>

Allow to create easily a WebMvc.fn RouterFunction with a router Kotlin DSL.