0

I have a controller which hands a java-list of model-objects to the view exactly the way like it's done in the examples.

The compiler throws an error that it can't convert from java.util.List to scala.collection.immutable.List. I have no clue what I should do.

[error] /myapp/myappsubprojects/frontend/app/controllers/frontend/MyController.java:15: error: method render in class linklist cannot be applied to given types;
[error]         return ok(linklist.render("link test", Link.findAll()));
[error]                           ^
[error]   required: String,scala.collection.immutable.List<Link>
[error]   found: String,java.util.List<Link>
[error]   reason: actual argument java.util.List<Link> cannot be converted to scala.collection.immutable.List<Link> by method invocation conversion
[error] 1 error

Note: I'm using subprojects (common, frontend, backend) and I had a hard time to make everything run properly. Probably it's related to that.

myborobudur
  • 4,385
  • 8
  • 40
  • 61
  • 2
    Do you have a `templatesImport` setting in your main project's `Build.scala` file? `java.util.*` should normally get automatically imported into each view template, one reason it might not however is if you override the list of default imports in your build file. – avik Apr 20 '13 at 10:01
  • That was the solution! Many thanks!! – myborobudur Apr 20 '13 at 11:15

1 Answers1

1

I went fishing for details and ended up (luckily) answering the question in my comment

Community
  • 1
  • 1
avik
  • 2,708
  • 17
  • 20