I'm trying to pass a list of strings from my java controller to the scala template.
This is the view code:
public static Result index() {
List<String> scripts = Arrays.asList(
"script1.js",
...
"scriptN.js"
);
return ok(views.html.index.render(scripts));
}
and this is the tempate code:
@(scripts: List[String])
@main("test page")(scripts) {
... html here ...
}
The error I'm getting (in the Typesafe Activation Compile page):
method render in class index cannot be applied to given types;
required: scala.collection.immutable.List
found: java.util.List
reason: actual argument java.util.List cannot be converted to scala.collection.immutable.List by method invocation conversion
Is there a way to solve it without using the java > scala conversions?
I found this question: Play doesn't convert java-list to scala-list which describes a similar situation, though I do not have any templateImports that I'm aware of, I don't even see a Build.scala file...
Any ideas? Thanks!