java - 使用struct2的標籤讀取不到Action裡面的字段
三叔
三叔 2017-06-12 09:25:08
0
1
831
分页代码
        private PageUntil pageuntil;
        @Resource
    private IAuthorAdminService iauthoradminservice;
    private AuthorAdmin authoradmin;
    private List<AuthorAdmin> listauthoradmin;



public String listAuthorAdmin() {
        pageuntil=new PageUntil();
        int currentPage = 0;
        int pagesize = pageuntil.getPagesize();
        currentPage =(currentPage == 0 ? 1 : currentPage);
        this.listauthoradmin = iauthoradminservice.queryPage(currentPage,
                pagesize);
        int countAuthorAdmin = iauthoradminservice.countAuthorAdmin();
        pageuntil
                .setPageCount(countAuthorAdmin % pagesize == 0 ? countAuthorAdmin
                        / pagesize
                        : countAuthorAdmin / pagesize + 1);

        return "listSuccess";

    }
分页实体类
public class PageUntil {
    private int pageCount;//总页数
    private int currentPage;//当前页
    private  int pagesize = 10;// 页最多显示多少条数据
    public int getPageCount() {
        return pageCount;
    }
    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }
    public int getCurrentPage() {
        return currentPage;
    }
    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }
    public int getPagesize() {
        return pagesize;
    }
    public void setPagesize(int pagesize) {
        this.pagesize = pagesize;
    
jsp分页片段
    <s:property value="pageuntil.pageCount" />
                页</li>
                <li>当前第<s:property value="pageuntil.currentPage" />页</li>

#如果不使用類別封裝分頁的欄位的話就能運行,不知道哪裡錯了?

三叔
三叔

全部回覆(1)
左手右手慢动作

換過另一種寫法就行了

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板