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

📄 pageform.java

📁 sample struct article, ... ...
💻 JAVA
字号:
/**
 * Copyright (C) 2003-2006 TiandiNet.com
 * 
 * Struts 文章系统 1.1
 * 
 * release-date: 2006-02-25
 */

package com.tiandinet.StrutsArticle.FormBeans;

import javax.servlet.http.*;

import org.apache.struts.action.*;
import java.util.HashMap;

/**
 * @author Meng Yang
 * @version 1.1
 */
public class PageForm
    extends ActionForm
{
    private String classId      = "*";
    private int    countPerPage = 20;
    private int    page         = 1;
		
		private HashMap nextLinkMap  = new HashMap();  //该变量用于存放上下页链接所用的Map,下一页
		private HashMap lastLinkMap  = new HashMap();  //该变量用于存放上下页链接所用的Map,上一页
		
		//上一页
		public HashMap getLastLinkMap()
		{
        this.lastLinkMap.put("classId",this.classId);
        this.lastLinkMap.put("page",String.valueOf(this.page-1));
				return this.lastLinkMap;
		}

		//下一页
		public HashMap getNextLinkMap()
		{
        this.nextLinkMap.put("classId",this.classId);
        this.nextLinkMap.put("page",String.valueOf(this.page+1));
				return this.nextLinkMap;
		}
		
    public String getClassId()
    {
        return classId;
    }

    public void setClassId(String classId)
    {
        this.classId = classId;
    }

    public int getCountPerPage()
    {
        return countPerPage;
    }

    public void setCountPerPage(int countPerPage)
    {
        this.countPerPage = countPerPage;
    }

    public int getPage()
    {
        return page;
    }

    public void setPage(int page)
    {
        this.page = page;
    }

    public ActionErrors validate(ActionMapping actionMapping,
                                 HttpServletRequest httpServletRequest)
    {
        /**@todo: finish this method, this is just the skeleton.*/
        return null;
    }

    public void reset(ActionMapping actionMapping,
                      HttpServletRequest httpServletRequest)
    {
        classId      = "*";
        countPerPage = 20;
        page         = 1;
    }
}

⌨️ 快捷键说明

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