java - 使用struct2的標簽讀取不到Action里面的字段
問題描述
分頁代碼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:換過另一種寫法就行了
相關文章:
1. android - weex 項目createInstanceReferenceError: Vue is not defined2. javascript - 如圖,百度首頁,查看源代碼為什么什么都沒有?3. 網頁爬蟲 - python requests爬蟲,如何post payload4. npm鏡像站全新上線5. angular.js - 求問大神?angularjs加載外部的html模板。有閃動如何解決6. html - 關于CSS實現border的0.5px設置?7. PHPExcel表格導入數據庫怎么導入8. android - 哪位大神知道java后臺的api接口的對象傳到前端后輸入日期報錯,是什么情況?求大神指點9. pdo 寫入到數據庫的內容為中文的時候寫入亂碼10. PHP類封裝的插入數據,總是插入不成功,返回false;
