-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed
Closed
Copy link
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix
Description
Hello all,
With java, to render template engine views i can use RouterFunction<?> in routes bean:
@SpringBootApplication
public class Application {
@Bean RouterFunction routes(final ApplicationHandlers handlers) {
return //...skipped
.andOther(route(GET("/").and(accept(TEXT_HTML)), handlers::index))
;
}
// main skipped..
so with that, I can use both, ServerResponse:
Mono<ServerResponse> index(final ServerRequest request) {
return ok().contentType(TEXT_HTML)
.render("index", singletonMap("message", "Hello, World!"))
;
}
and RenderingResponse:
Mono<RenderingResponse> index(final ServerRequest request) {
return create("index").modelAttribute("message", "Hello, World!")
.build()
;
}
but unfortunately I can't do similar with Kotlin DSL:
Only Mono<ServerResponse>
handler like so:
val index: Mono<ServerResponse> by lazy {
ok().contentType(TEXT_HTML)
.render("index", mapOf("message" to "hey"))
}
will works correctly... RenderingResponse
extends ServerResponse
, but unfortunately Mono<RenderingResponse>
doesn't extend Mono<ServerResponse>
I think it's bug
Regards,
Maksim
Metadata
Metadata
Assignees
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix