• 大小: 18.9MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-19
  • 语言: 其他
  • 标签:

资源简介

因为是完整的,经过本人测试,花了比较久的时间,希望有点回报,赚点积分

资源截图

代码片段和文件信息

package com.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.dao.TAdminDAO;
import com.model.TAdmin;
import com.opensymphony.xwork2.ActionSupport;
import com.util.Pagination;

public class adminAction extends ActionSupport
{
private int userId;
private String userName;
private String userPw;
 
private String message;
private String path;

private int index=1;

private TAdminDAO adminDAO;


public String adminAdd()
{
TAdmin admin=new TAdmin();
admin.setUserName(userName);
admin.setUserPw(userPw);
adminDAO.save(admin);
this.setMessage(“操作成功“);
this.setPath(“adminManage.action“);
return “succeed“;
}



public String adminManage()
{
List adminList=adminDAO.findAll();
Map request=(Map)ServletActionContext.getContext().get(“request“);
request.put(“adminList“ adminList);
return ActionSupport.SUCCESS;
}

public String adminManageFenye()
{
List adminList=adminDAO.findAll();
int pageSize=3;
int fromIndex = (index - 1) * pageSize;
int toIndex = Math.min(fromIndex + pageSize adminList.size());
List adminListFenye = adminList.subList(fromIndex toIndex);


        Pagination p = new Pagination();//创建 分页对象
        p.setIndex(index);//设置页数
        p.setPageSize(pageSize);
        p.setTotle(adminList.size());//设置总共的条数
        p.setData(adminListFenye);//设置数据
        p.setPath(“adminManageFenye.action?“);//跳转的路径

Map request=(Map)ServletActionContext.getContext().get(“request“);
request.put(“page“ p);
return ActionSupport.SUCCESS;
}

public String adminDel()
{
adminDAO.delete(adminDAO.findById(userId));
this.setMessage(“删除成功“);
this.setPath(“adminManage.action“);
return “succeed“;
}



public TAdminDAO getAdminDAO()
{
return adminDAO;
}

public void setAdminDAO(TAdminDAO adminDAO)
{
this.adminDAO = adminDAO;
}

public String getMessage()
{
return message;
}

public int getIndex()
{
return index;
}



public void setIndex(int index)
{
this.index = index;
}



public void setMessage(String message)
{
this.message = message;
}

public String getPath()
{
return path;
}

public void setPath(String path)
{
this.path = path;
}

public int getUserId()
{
return userId;
}

public void setUserId(int userId)
{
this.userId = userId;
}

public String getUserName()
{
return userName;
}

public void setUserName(String userName)
{
this.userName = userName;
}

public String getUserPw()
{
return userPw;
}

public void setUserPw(String userPw)
{
this.userPw = userPw;
}
 
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-08-19 14:22  TeacherPingJia\
     文件        5460  2012-03-14 01:28  TeacherPingJia\.classpath
     目录           0  2017-08-19 14:23  TeacherPingJia\.myeclipse\
     文件         533  2012-03-14 01:32  TeacherPingJia\.myhibernatedata
     文件         316  2014-01-10 10:57  TeacherPingJia\.mymetadata
     文件        1826  2017-08-04 22:12  TeacherPingJia\.project
     目录           0  2017-08-02 00:18  TeacherPingJia\.settings\
     文件         503  2016-04-18 21:38  TeacherPingJia\.settings\.jsdtscope
     文件         670  2017-07-21 19:11  TeacherPingJia\.settings\org.eclipse.jdt.core.prefs
     文件         491  2017-08-04 22:15  TeacherPingJia\.settings\org.eclipse.wst.common.component
     文件         345  2016-04-18 21:38  TeacherPingJia\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-04-18 21:38  TeacherPingJia\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-04-18 21:38  TeacherPingJia\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件         474  2013-05-06 13:27  TeacherPingJia\.springBeans
     目录           0  2017-08-01 23:02  TeacherPingJia\WebRoot\
     目录           0  2017-08-01 23:02  TeacherPingJia\WebRoot\meta-INF\
     文件          39  2012-02-09 02:07  TeacherPingJia\WebRoot\meta-INF\MANIFEST.MF
     目录           0  2017-08-01 23:02  TeacherPingJia\WebRoot\My97DatePicker\
     文件        1146  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\My97DatePicker.htm
     文件        8566  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\WdatePicker.js
     文件       29621  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\calendar.js
     文件         300  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\config.js
     目录           0  2017-08-01 23:02  TeacherPingJia\WebRoot\My97DatePicker\lang\
     文件         345  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\lang\en.js
     文件         579  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\lang\zh-cn.js
     文件         579  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\lang\zh-tw.js
     目录           0  2017-08-01 23:02  TeacherPingJia\WebRoot\My97DatePicker\skin\
     文件         153  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\skin\WdatePicker.css
     文件        1043  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\skin\datePicker.gif
     目录           0  2017-08-01 23:02  TeacherPingJia\WebRoot\My97DatePicker\skin\default\
     文件        3086  2012-02-09 02:07  TeacherPingJia\WebRoot\My97DatePicker\skin\default\datepicker.css
............此处省略532个文件信息

评论

共有 条评论

相关资源