我尝试在应用程序中同时使用分页和表格模块,但列表显示不正确。我正在使用 play 1.2.5 。
这是我所做的:-
用户模型:
package models;
import java.util.*;
import javax.persistence.*;
import play.db.jpa.*;
@Entity
public class users extends Model {
public String email;
public String password;
public String username;
public users(String email, String password, String username) {
this.email = email;
this.password = password;
this.username = username;
}
}
控制器:
package controllers; import play.*; import play.mvc.*; import java.util.*; import play.modules.paginate.ModelPaginator; import models.*;
public class Application extends Controller { public static void index() { ModelPaginator paginator = new ModelPaginator(users.class); render(paginator); }
}
风景:
#{paginate.list items : paginator, as 'r'}
#{table r/}
#{/paginate.list}
这样做但效果不佳
那么有什么问题呢?