• 大小: 20.63MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-21
  • 语言: Java
  • 标签: jsp  Tomcat  

资源简介

jsp Tomcat server学生宿舍管理系统 自己导入数据包到数据库,把项目导入到my ecilipse运行即可

资源截图

代码片段和文件信息

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  2018-03-18 10:41  sushe\
     文件        5530  2012-12-13 15:38  sushe\.classpath
     目录           0  2018-03-18 10:41  sushe\.myeclipse\
     文件         528  2012-12-10 22:48  sushe\.myhibernatedata
     文件         288  2018-05-21 17:45  sushe\.mymetadata
     文件        1633  2012-04-01 23:23  sushe\.project
     目录           0  2018-03-18 10:42  sushe\.settings\
     文件         143  2018-03-18 10:43  sushe\.settings\org.eclipse.core.resources.prefs
     文件         330  2012-04-01 23:23  sushe\.settings\org.eclipse.jdt.core.prefs
     文件         415  2018-03-18 10:42  sushe\.springBeans
     目录           0  2018-05-21 22:21  sushe\src\
     目录           0  2018-03-18 10:41  sushe\src\com\
     目录           0  2018-03-18 10:41  sushe\src\com\action\
     文件        2785  2012-04-01 23:23  sushe\src\com\action\adminAction.java
     文件        3004  2012-04-01 23:23  sushe\src\com\action\baoxiuAction.java
     文件        3165  2012-12-10 23:02  sushe\src\com\action\laifangAction.java
     文件        2634  2012-12-10 22:31  sushe\src\com\action\shuidianAction.java
     文件        4572  2012-12-11 07:37  sushe\src\com\action\stuAction.java
     文件        1924  2018-05-21 21:57  sushe\src\com\action\susheAction.java
     文件        2532  2018-05-22 22:01  sushe\src\com\action\weishengAction.java
     文件        3451  2012-12-10 23:10  sushe\src\com\action\yishiAction.java
     目录           0  2018-03-18 10:41  sushe\src\com\dao\
     文件        3980  2012-04-01 23:23  sushe\src\com\dao\TAdminDAO.java
     文件        4667  2012-04-01 23:23  sushe\src\com\dao\TBaoxiuDAO.java
     文件        4765  2012-04-01 23:23  sushe\src\com\dao\TLaifangDAO.java
     文件        3829  2012-12-10 22:13  sushe\src\com\dao\TShuidianDAO.java
     文件        5129  2012-04-01 23:23  sushe\src\com\dao\TStuDAO.java
     文件        4579  2018-05-21 21:57  sushe\src\com\dao\TSusheDAO.java
     文件        4563  2012-04-01 23:23  sushe\src\com\dao\TWeishengDAO.java
     文件        3733  2012-12-10 22:48  sushe\src\com\dao\TYishiDAO.java
     目录           0  2018-03-18 10:41  sushe\src\com\model\
............此处省略941个文件信息

评论

共有 条评论