⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 changepageaction.java

📁 bbs struts
💻 JAVA
字号:
public class ChangePageAction extends Action {

 
 
 

 
 
 public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {   
String action; 
action=request.getParameter("action");   

DBTopicFactory fa=  getInstance();
int total=fa.sumtopic();
PageBean pb=(PageBean )request.getSession().getAtttribute("page");
pb.setTotalRow(total);

int max=pb.getPageRecorders();
if(action.equals("nextPage"))
  {
  
    if(pb.isHasNextPage())
    {
    pb.getNextPage();
    pb.setTopics(fa.topicList(max,pb.getCurrentPage());
    
    }
    }
    if(action.equals("previousPage"))
    {
    if(pb.isHasPreviousPage())
    {
    pb.getPreviousPage();
    pb.setTopics(fa.topicList(max,pb.getCurrentPage());
    
    }
    }
    if(action==null||action.equals(""))
    
    pb.setTopics(fa.topicList(max,1);
    
    return (mapping.findForward("list"));
  }
    

⌨️ 快捷键说明

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