我有这个 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()))
}
我想在模板中使用bean变量,但是IntelliJ在编辑时无法识别 map 中的任何变量,因为带有Kotlin的ThymeLeaf和IntelliJ自动完成功能在发送到模板的有效载荷是带有前一个 map 的 map 时不起作用句法。有什么办法可以在编辑时完成之前的代码?
Related link
最佳答案
这是一个已知问题:
关于kotlin - IntelliJ具有ThymeLeaf,Kotlin,ModelAndView和mapOf的自动完成功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63319519/