Kush Patel
11/23/2020, 3:47 AMspring-fu/kofu
and so far I’m a fan. However, I’m having a hard time rendering my index.html
which exists in the build/resources/main/static/
folder. My app is pretty small so far but the error I’m getting is the following. I believe when I visit <http://localhost:8080/>
my index.html
should render
javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:210)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:148)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:316)
val app: KofuApplication = webApplication {
webMvc {
converters {
resource()
}
router {
accept(MediaType.TEXT_HTML).nest {
GET("/") {
ServerResponse.ok().render("index")
}
}
resources("/**", ClassPathResource("static/"))
}
}
}
fun main(args: Array<String>) {
app.run(args)
}