Search code examples
kotlinintellij-ideathymeleaf

IntelliJ autocomplete with ThymeLeaf, Kotlin, ModelAndView and mapOf?


I have this controller:

@Controller
class MainController(
        val performanceRepository: PerformanceRepository
) {
    @RequestMapping("")
    fun homePage() = ModelAndView("seatBooking", mapOf(
            "performances" to performanceRepository.findAll(),
            "seatNums" to 1..10,
            "seatRows" to 'A'..'F',
            "bean" to CheckAvailabilityBackingBean()))
}

I want to use the bean variable in the template, but IntelliJ in editing time, is not recognizing anyone variable from the map, as is ThymeLeaf with Kotlin and IntelliJ autocomplete is not working when the payload sent to the template is a map with the previous syntax.

is there any way to do the previus code work in editing time?

Related link


Solution

  • It's a known issue:

    • IDEA-199754 Spring MVC with Kotlin: model attributes added to model as map (via model.addAllAttributes or modelAndView.addAllObjects()) are not resolved