pagelistaction.java.bak

来自「bbs struts」· BAK 代码 · 共 41 行

BAK
41
字号
public class PageListAction extends Action {

 public PageListAction(){}
 PageBean pb;
 
 DBTopicFactory fa=   getInstantce();
 
 
 public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {   
String action; 
action=request.getParameter("action");   
String page=request.getParameter("current");
int current=Interger.Parse(page);
int total=fa.sumtopic();
pb=request.getSession().getAtttribute("page");

pb.setCurrentPage(current);

if(action.equals("nextPage"))
  {
  
    if(pb.isHasNextPage())
    {
    pb.getNextPage();
    pb.setTopics(fa.topicList(pb.getCurrentPage());
    
    }
    }
    if(action.equals("previousPage"))
    {
    if(pb.isHasPreviousPage())
    {
    pb.getNextPage();
    pb.setTopics(fa.topicList(pb.getCurrentPage());
    
    }
    }
    
    return (mapping.findForward("listAll"));
  }
    

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?