spring-fu icon indicating copy to clipboard operation
spring-fu copied to clipboard

FreeMarker auto config not working

Open dragneelfps opened this issue 3 years ago • 2 comments

Following does not work. Give error: java.lang.IllegalArgumentException: Could not resolve view with name 'hello'

val app = reactiveWebApplication {

    webFlux {
        codecs {
            string()
            jackson()
        }
        coRouter {
            (GET("/hello") and accept(MediaType.TEXT_HTML)) {
                ok().renderAndAwait("hello")
            }
        }
    }

}

fun main(args: Array<String>) {
    app.run(args)
}

I set up a debug point at FreeMarkerAutoConfiguration but its not loading.

But This works:

@SpringBootApplication
class PasteApplication

fun main(args: Array<String>) {
    runApplication<PasteApplication>(*args)
}

@Controller
class Foo {
    @GetMapping("/hello")
    fun bar(): String {
        return "hello"
    }
}

May be I am missing some configuration. Please help.

dragneelfps avatar Jul 20 '20 17:07 dragneelfps

Seems like we need to create initializer for FreeMarker like already done for Mustache.

dragneelfps avatar Jul 22 '20 21:07 dragneelfps

Reopening issue to add such support.

sdeleuze avatar Sep 24 '20 12:09 sdeleuze