changepageaction.java
来自「bbs struts」· Java 代码 · 共 44 行
JAVA
44 行
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 + =
减小字号Ctrl + -
显示快捷键?