我正在使用 Java Play Framework 并尝试将数组值从控制器传递到视图,但出现错误。我的代码在这里:
public class Application extends Controller {
public static Result index() {
String s= "Hello Mr.View";
String st[] = {"firstValue","second","third","fourth"};
return ok(index.render(st));
}
}
我的模板是:
@(message: String)
@import helper._
@import models._
@import java.sql._
<h1>@message </hl>
如何解决此错误?