示例#1
0
 public String query() throws Exception {
   // 获得session
   String sessionType;
   String sessionId;
   Map<String, Object> session = ActionContext.getContext().getSession();
   sessionId = (String) session.get("sessionId");
   sessionType = (String) session.get("sessionType");
   if ((sessionType == null || sessionId == null) && sessionType != "3") {
     addActionError("用户不存在!");
     return ERROR;
   }
   views6s = views6DAO.findAll();
   if (page == 0) page = 1;
   totalPage = views6s.size() / 10 + 1;
   // 每页显示10条
   int listStart = (page - 1) * 10;
   int listEnd = page * 10; // which is exclusive
   if (listEnd >= views6s.size()) listEnd = views6s.size();
   views6s = views6s.subList(listStart, listEnd);
   return SUCCESS;
 }
示例#2
0
 public String Excel() {
   views6s = views6DAO.findAll();
   return "excel";
 }