struts1 分页

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.vaannila;

import java.util.ArrayList;

/**
 *
 * @author eswar@vaannila.com
 */
public class ActorData {

    private String tvShow;
    private String userName;
    private String emailId;

    public ActorData()
    {
        
    }
    
    public ActorData(String tvShow, String userName, String emailId)
    {
        this.tvShow = tvShow;
        this.userName = userName;
        this.emailId = emailId;
    }

    public ArrayList loadData()
    {
        ArrayList userList = new ArrayList();
        userList.add(new ActorData("The Office","Michael Scott","michael.scott@dundermifflin.com"));
        userList.add(new ActorData("The Office","Dwight Schrute","dwight.schrute@dundermifflin.com"));
        userList.add(new ActorData("The Office","Jim Halpert","jim.halpert@dundermifflin.com"));
        userList.add(new ActorData("The Office","Pam Beesly","pam.beesly@dundermifflin.com"));
        userList.add(new ActorData("The Office","Andy Bernad","andy.bernad@dundermifflin.com"));
        userList.add(new ActorData("The Office","Angela Martin","angela.martin@dundermifflin.com"));
        userList.add(new ActorData("Friends","Rachel Green","rachel.green@friends.com"));
        userList.add(new ActorData("Friends","Monica Geller","monica.geller@friends.com"));
        userList.add(new ActorData("Friends","Phoebe Buffay","phoebe.buffay@friends.com"));
        userList.add(new ActorData("Friends","Joey Tribbiani","joey.tribbiani@friends.com"));
        userList.add(new ActorData("Friends","Chandler Bing","chandler.bing@friends.com"));
        userList.add(new ActorData("Friends","Ross Geller","ross.geller@friends.com"));
        return userList;
    }

    /**
     * @return the tvShow
     */
    public String getTvShow() {
        return tvShow;
    }

    /**
     * @return the userName
     */
    public String getUserName() {
        return userName;
    }

    /**
     * @return the emailId
     */
    public String getEmailId() {
        return emailId;
    }
 
}
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>User Details</title>
        <link href="css/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <display:table id="data" name="sessionScope.UserForm.actorList" requestURI="/userAction.do" pagesize="10" >
            <display:column property="tvShow" title="TV Show" sortable="true"   />
            <display:column property="userName" title="User Name" sortable="true"  />
            <display:column property="emailId" title="Email Id" sortable="true"  />
        </display:table>
    </body>
</html>

原文:http://www.dzone.com/tutorials/java/struts/struts-example/struts-pagination-example-1.html

源代码:http://pan.baidu.com/share/link?shareid=4115038114&uk=3878681452



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值