• 大小: 4.55MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-20
  • 语言: Java
  • 标签:

资源简介

校园宿舍管理系统、毕业论文、毕业设计、struts2、jsp、mysql

资源截图

代码片段和文件信息

package com.action;

import java.io.PrintWriter;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;

import com.bean.*;
import com.dao.*;


public class AdminLog extends ActionSupport {

//下面是Action内用于封装用户请求参数的属性
private List buildinglist;
private List domitorylist;

public List getBuildinglist() {
return buildinglist;
}

public void setBuildinglist(List buildinglist) {
this.buildinglist = buildinglist;
}

public List getDomitorylist() {
return domitorylist;
}

public void setDomitorylist(List domitorylist) {
this.domitorylist = domitorylist;
}

private String BuildingID;
private String DomitoryID;
public String getBuildingID() {
return BuildingID;
}

public void setBuildingID(String buildingID) {
BuildingID = buildingID;
}

public String getDomitoryID() {
return DomitoryID;
}

public void setDomitoryID(String domitoryID) {
DomitoryID = domitoryID;
}

//处理用户请求的execute方法
public String execute() throws Exception {

//解决乱码,用于页面输出
HttpServletResponse response=null;
response=ServletActionContext.getResponse();
response.setContentType(“text/html;charset=UTF-8“);
response.setCharacterEncoding(“UTF-8“);
PrintWriter out = response.getWriter();

//创建session对象
HttpSession session = ServletActionContext.getRequest().getSession();
//验证是否正常登录
if(session.getAttribute(“id“)==null){
out.print(“ript language=‘javascript‘>alert(‘请重新登录!‘);window.location=‘Login.jsp‘;ript>“);
out.flush();out.close();return null;
}

//查询楼宇
buildinglist=new BuildingDao().GetList(“““Building_Name“);
// System.out.println(BuildingID);
//查询条件
String strWhere=“1=1 “;
if(!(isInvalid(BuildingID)))
{
strWhere+=“ and Domitory_BuildingID=‘“+BuildingID+“‘“;
}
else{
strWhere+=“ and 1=2“;
}
//查询寝室
domitorylist=new DomitoryDao().GetList(strWhere“Domitory_Name“);

return SUCCESS;

}

//判断是否空值
private boolean isInvalid(String value) {
return (value == null || value.length() == 0);
}

//测试
public static void main(String[] args) {
System.out.println();
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        841  2015-09-20 16:48  sushe\.classpath

     文件       1038  2013-04-28 15:29  sushe\.project

     文件        503  2013-04-28 15:29  sushe\.settings\.jsdtscope

     文件        231  2015-09-20 17:46  sushe\.settings\org.eclipse.core.resources.prefs

     文件        598  2015-09-20 16:47  sushe\.settings\org.eclipse.jdt.core.prefs

     文件        445  2013-04-28 15:29  sushe\.settings\org.eclipse.wst.common.component

     文件        345  2015-09-20 16:48  sushe\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2013-04-28 15:29  sushe\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2013-04-28 15:29  sushe\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       3870  2015-09-20 17:13  sushe\build\classes\com\action\AdminLog.class

     文件       3736  2015-09-20 17:13  sushe\build\classes\com\action\AdminLogList.class

     文件       3382  2015-09-20 17:13  sushe\build\classes\com\action\BuildingAddSave.class

     文件       2410  2015-09-20 17:13  sushe\build\classes\com\action\BuildingDel.class

     文件       3128  2015-09-20 17:13  sushe\build\classes\com\action\BuildingManager.class

     文件       2638  2015-09-20 17:13  sushe\build\classes\com\action\BuildingUpdate.class

     文件       3775  2015-09-20 17:13  sushe\build\classes\com\action\BuildingUpdateSave.class

     文件       2585  2015-09-20 17:13  sushe\build\classes\com\action\DomitoryAdd.class

     文件       4247  2015-09-20 17:13  sushe\build\classes\com\action\DomitoryAddSave.class

     文件       2410  2015-09-20 17:13  sushe\build\classes\com\action\DomitoryDel.class

     文件       4143  2015-09-20 17:13  sushe\build\classes\com\action\DomitoryManager.class

     文件       3252  2015-09-20 17:13  sushe\build\classes\com\action\DomitoryUpdate.class

     文件       4583  2015-09-20 17:13  sushe\build\classes\com\action\DomitoryUpdateSave.class

     文件       2551  2015-09-20 17:13  sushe\build\classes\com\action\GoLogin.class

     文件       2606  2015-09-20 17:13  sushe\build\classes\com\action\LogAdd.class

     文件       3119  2015-09-20 17:13  sushe\build\classes\com\action\LogAddSave.class

     文件       2704  2015-09-20 17:13  sushe\build\classes\com\action\MyLog.class

     文件       4371  2015-09-20 17:13  sushe\build\classes\com\action\MyLogList.class

     文件       2716  2015-09-20 17:13  sushe\build\classes\com\action\MyStudent.class

     文件       4380  2015-09-20 17:13  sushe\build\classes\com\action\MyStudentList.class

     文件       2555  2015-09-20 17:13  sushe\build\classes\com\action\OutList.class

............此处省略201个文件信息

评论

共有 条评论