Play Framework 2.2.1 - Compilation error: “method render in class index cannot be applied to given types;”

后端 未结 3 796
[愿得一人]
[愿得一人] 2020-12-20 22:17

I am new to Play Framework, and attempting to build a Todo-list from this manual.

When I try to run the application I get the error:

Compilation          


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-20 23:01

    It looks like Task.all() returns a Java list, while the scala template is probably expecting a Scala list.

    I woul suggest changing the return type of Task.all() if possible, or fully qualified the definition in the template:

    @(tasks: java.util.List[Models.Task], taskForm: Form[Models.Task])
    

提交回复
热议问题