首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

标签约义

2012-06-28 
标签定义package com.duty.utilimport javax.servlet.http.HttpServletRequestimport javax.servlet.htt

标签定义
package com.duty.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

public class PageTag extends ComponentTagSupport { 
   
    private static final long serialVersionUID = 7242423813230124088L; 
    //这里传递的参数需要用字符串的形式 
    private String pageNo; 
    private String total; 
    private String includes; 
 
    public void setPageNo(String pageNo) { 
        this.pageNo = pageNo; 
    } 
 
    public void setTotal(String total) { 
        this.total = total; 
    } 
 
    public String getIncludes() { 
        return includes; 
    } 
 
    public void setIncludes(String includes) { 
        this.includes = includes; 
    } 
 
    @Override 
    public Component getBean(ValueStack arg0, HttpServletRequest arg1, 
            HttpServletResponse arg2) { 
        return new Pages(arg0); 
    } 
 
    protected void populateParams() { 
        super.populateParams(); 
 
        Pages pages = (Pages) component; 
        pages.setPageNo(pageNo); 
        pages.setIncludes(includes); 
        pages.setTotal(total); 
 
    }



热点排行