Let's consider this request handler:
@GetMapping("/")
public Mono<String> index(Model model) {
model.addAttribute("list", Flux.just("item1", "item2"));
return Mono.just("list"); // <- Template name
}
If there is an index.html template in the templates directory, this handler is not excuted.
If I return Mono.just("index") from the handler:
@GetMapping("/")
public Mono<String> index(Model model) {
model.addAttribute("list", Flux.just("item1", "item2"));
return Mono.just("index"); // <- Template name
}
This handler is still not used.
It seems like I have to remove the index.html template from the templates directory for the GetMapping("/") route to be handled.
So my question is, is it possible to return a Mono.just("index") from a GetMapping("/") handler ?