【发布时间】:2016-10-30 19:08:17
【问题描述】:
我是这个框架的新手! 我想为我的模型生成一个分页器,以在模板中显示我的光照。
我正在使用 Play-java、Ebean、scala.html 模板。
谢谢!
我有这个!
型号:
public static Finder<String,User> find = new Finder(
String.class, User.class
);
public static List<User> all(){
return find.all();
}
控制器:
public class UserController extends Controller {
public Result index() {
return ok(list_users.render(User.all()));
}
}
查看 (list_user.scala.html)
<table>
<thead>
<tr>
<th>Email</th>
<th>Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
@for(user<- users){
<tr>
<td>@user.getEmail()</td>
<td>@user.getName()</td>
<td>@user.getLastName()</td>
</tr>
}
</tbody>
</table>
【问题讨论】:
标签: java web playframework pagination