diff --git a/WebContent/Electric.jsp b/WebContent/Electric.jsp new file mode 100644 index 0000000..594360a --- /dev/null +++ b/WebContent/Electric.jsp @@ -0,0 +1,59 @@ +<%@ page import="java.util.Date" %> +<%@ page import="java.text.SimpleDateFormat" %><%-- + Created by IntelliJ IDEA. + User: Vie + Date: 2019/10/24 + Time: 15:25 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + + 电费使用情况 + + +
欢迎你,<%=request.getParameter("Username")%>
+
+ + + + + + + + + + +
高校公寓管理系统
 
+ + + + +
+ <%@ include file="StudentLeft.jsp"%> + + + +
+
+
+ +   + +
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + + diff --git a/WebContent/ElectricManage.jsp b/WebContent/ElectricManage.jsp new file mode 100644 index 0000000..a269af7 --- /dev/null +++ b/WebContent/ElectricManage.jsp @@ -0,0 +1,82 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/12/30 + Time: 10:04 + To change this template use File | Settings | File Templates. +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="java.sql.PreparedStatement"%> +<%@page import="java.sql.DriverManager"%> +<%@page import="java.sql.Connection"%> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.Date" %> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + 学生信息 + + + +<% + String driver = "com.mysql.cj.jdbc.Driver"; + String url = "jdbc:mysql://localhost:3306/test?characterEncoding=utf-8" + +"&serverTimezone=GMT"+ "&useUnicode=true"+"&useSSL=false" ; + String usr = "root"; + String password = "123456"; + Class.forName("com.mysql.cj.jdbc.Driver"); + Connection conn = DriverManager.getConnection(url, usr, password); + String sqlString = "select * from electricity"; + PreparedStatement pstmt = conn.prepareStatement(sqlString); + ResultSet rs = pstmt.executeQuery(); +%> + +<%--
欢迎你,<%=request.getParameter("username")%>--%> + +<%-- 退出--%> + +<%--
--%> + +

宿舍电费列表

+ +
+ + + + + + + + + + <% + while (rs.next()) { + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + } + %> + +
宿舍号电费余额操作
" + rs.getString("Electricity_id") + "" + rs.getString("Electricity_cost") + "修改
+ +
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + + diff --git a/WebContent/ElectricRepaired.jsp b/WebContent/ElectricRepaired.jsp new file mode 100644 index 0000000..6318750 --- /dev/null +++ b/WebContent/ElectricRepaired.jsp @@ -0,0 +1,154 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/11/20 + Time: 11:32 + To change this template use File | Settings | File Templates. +--%> +<%--<%@ page contentType="text/html;charset=UTF-8" language="java" %>--%> + +<%--<%@page import="com.sun.xml.internal.txw2.Document"%>--%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8" import="java.util.*"%> + + + + + +动态表格 + + + + + +

动态表格

+ + + + + + +
序号题目一题目二题目三
+ +
+ diff --git a/WebContent/Images/1.png b/WebContent/Images/1.png new file mode 100644 index 0000000..91ee7ba Binary files /dev/null and b/WebContent/Images/1.png differ diff --git a/WebContent/Images/12.png b/WebContent/Images/12.png new file mode 100644 index 0000000..07a253a Binary files /dev/null and b/WebContent/Images/12.png differ diff --git a/WebContent/Images/1212.jpg b/WebContent/Images/1212.jpg new file mode 100644 index 0000000..2554cb9 Binary files /dev/null and b/WebContent/Images/1212.jpg differ diff --git a/WebContent/Images/157776728736064.png b/WebContent/Images/157776728736064.png new file mode 100644 index 0000000..4dd7431 Binary files /dev/null and b/WebContent/Images/157776728736064.png differ diff --git a/WebContent/Images/2.png b/WebContent/Images/2.png new file mode 100644 index 0000000..91ee7ba Binary files /dev/null and b/WebContent/Images/2.png differ diff --git a/WebContent/Images/LoginBg.jpg b/WebContent/Images/LoginBg.jpg new file mode 100644 index 0000000..25fef9e Binary files /dev/null and b/WebContent/Images/LoginBg.jpg differ diff --git a/WebContent/Images/MenuBg.jpg b/WebContent/Images/MenuBg.jpg new file mode 100644 index 0000000..5be8a53 Binary files /dev/null and b/WebContent/Images/MenuBg.jpg differ diff --git a/WebContent/Images/T(O8JNVG9RJ~H_O_TN8VLSD.jpg b/WebContent/Images/T(O8JNVG9RJ~H_O_TN8VLSD.jpg new file mode 100644 index 0000000..4a67ffe Binary files /dev/null and b/WebContent/Images/T(O8JNVG9RJ~H_O_TN8VLSD.jpg differ diff --git a/WebContent/Images/Thumbs.db b/WebContent/Images/Thumbs.db new file mode 100644 index 0000000..c25c35f Binary files /dev/null and b/WebContent/Images/Thumbs.db differ diff --git a/WebContent/Images/bg001.jpg b/WebContent/Images/bg001.jpg new file mode 100644 index 0000000..76fe195 Binary files /dev/null and b/WebContent/Images/bg001.jpg differ diff --git a/WebContent/Images/bg002.jpg b/WebContent/Images/bg002.jpg new file mode 100644 index 0000000..2d0c939 Binary files /dev/null and b/WebContent/Images/bg002.jpg differ diff --git a/WebContent/Images/bg003.jpg b/WebContent/Images/bg003.jpg new file mode 100644 index 0000000..ad32274 Binary files /dev/null and b/WebContent/Images/bg003.jpg differ diff --git a/WebContent/Images/bg11.jpg b/WebContent/Images/bg11.jpg new file mode 100644 index 0000000..7c44deb Binary files /dev/null and b/WebContent/Images/bg11.jpg differ diff --git a/WebContent/Images/bj_zhuce.jpg b/WebContent/Images/bj_zhuce.jpg new file mode 100644 index 0000000..013d98e Binary files /dev/null and b/WebContent/Images/bj_zhuce.jpg differ diff --git a/WebContent/Images/bootBg.jpg b/WebContent/Images/bootBg.jpg new file mode 100644 index 0000000..f8cd638 Binary files /dev/null and b/WebContent/Images/bootBg.jpg differ diff --git a/WebContent/Images/btn_shangchuan.jpg b/WebContent/Images/btn_shangchuan.jpg new file mode 100644 index 0000000..c922e9c Binary files /dev/null and b/WebContent/Images/btn_shangchuan.jpg differ diff --git a/WebContent/Images/center-menu-icon.png b/WebContent/Images/center-menu-icon.png new file mode 100644 index 0000000..f6e337d Binary files /dev/null and b/WebContent/Images/center-menu-icon.png differ diff --git a/WebContent/Images/close-h.gif b/WebContent/Images/close-h.gif new file mode 100644 index 0000000..47b6ecb Binary files /dev/null and b/WebContent/Images/close-h.gif differ diff --git a/WebContent/Images/close.gif b/WebContent/Images/close.gif new file mode 100644 index 0000000..f84a24f Binary files /dev/null and b/WebContent/Images/close.gif differ diff --git a/WebContent/Images/delete.png b/WebContent/Images/delete.png new file mode 100644 index 0000000..c528cdf Binary files /dev/null and b/WebContent/Images/delete.png differ diff --git a/WebContent/Images/delete_f.png b/WebContent/Images/delete_f.png new file mode 100644 index 0000000..163042f Binary files /dev/null and b/WebContent/Images/delete_f.png differ diff --git a/WebContent/Images/diy_39.jpg b/WebContent/Images/diy_39.jpg new file mode 100644 index 0000000..d5f82ca Binary files /dev/null and b/WebContent/Images/diy_39.jpg differ diff --git a/WebContent/Images/diy_41.jpg b/WebContent/Images/diy_41.jpg new file mode 100644 index 0000000..e67969f Binary files /dev/null and b/WebContent/Images/diy_41.jpg differ diff --git a/WebContent/Images/diy_biaochi_bg.jpg b/WebContent/Images/diy_biaochi_bg.jpg new file mode 100644 index 0000000..57e6b74 Binary files /dev/null and b/WebContent/Images/diy_biaochi_bg.jpg differ diff --git a/WebContent/Images/dorm.png b/WebContent/Images/dorm.png new file mode 100644 index 0000000..675bccb Binary files /dev/null and b/WebContent/Images/dorm.png differ diff --git a/WebContent/Images/duigou_bai.png b/WebContent/Images/duigou_bai.png new file mode 100644 index 0000000..147606b Binary files /dev/null and b/WebContent/Images/duigou_bai.png differ diff --git a/WebContent/Images/ecjtu_logo.ico b/WebContent/Images/ecjtu_logo.ico new file mode 100644 index 0000000..6790ef9 Binary files /dev/null and b/WebContent/Images/ecjtu_logo.ico differ diff --git a/WebContent/Images/edit-delete.png b/WebContent/Images/edit-delete.png new file mode 100644 index 0000000..b2d3227 Binary files /dev/null and b/WebContent/Images/edit-delete.png differ diff --git a/WebContent/Images/ewm.html b/WebContent/Images/ewm.html new file mode 100644 index 0000000..6bd48d4 --- /dev/null +++ b/WebContent/Images/ewm.html @@ -0,0 +1 @@ +Apache Tomcat/8.0.8 - Error report

HTTP Status 404 - /images/ewm.png

type Status report

message /images/ewm.png

description The requested resource is not available.


Apache Tomcat/8.0.8

\ No newline at end of file diff --git a/WebContent/Images/headImg-01.png b/WebContent/Images/headImg-01.png new file mode 100644 index 0000000..2fdd2dd Binary files /dev/null and b/WebContent/Images/headImg-01.png differ diff --git a/WebContent/Images/headImg-02.png b/WebContent/Images/headImg-02.png new file mode 100644 index 0000000..a4c7647 Binary files /dev/null and b/WebContent/Images/headImg-02.png differ diff --git a/WebContent/Images/headImg-03.png b/WebContent/Images/headImg-03.png new file mode 100644 index 0000000..058270f Binary files /dev/null and b/WebContent/Images/headImg-03.png differ diff --git a/WebContent/Images/headImg-btn.png b/WebContent/Images/headImg-btn.png new file mode 100644 index 0000000..34995d0 Binary files /dev/null and b/WebContent/Images/headImg-btn.png differ diff --git a/WebContent/Images/home.png b/WebContent/Images/home.png new file mode 100644 index 0000000..17183fc Binary files /dev/null and b/WebContent/Images/home.png differ diff --git a/WebContent/Images/ic.gif b/WebContent/Images/ic.gif new file mode 100644 index 0000000..2ff16e9 Binary files /dev/null and b/WebContent/Images/ic.gif differ diff --git a/WebContent/Images/iconfont-close.png b/WebContent/Images/iconfont-close.png new file mode 100644 index 0000000..71c3563 Binary files /dev/null and b/WebContent/Images/iconfont-close.png differ diff --git a/WebContent/Images/iconfont-nvshelp.png b/WebContent/Images/iconfont-nvshelp.png new file mode 100644 index 0000000..d732f17 Binary files /dev/null and b/WebContent/Images/iconfont-nvshelp.png differ diff --git a/WebContent/Images/iconfont-rili.png b/WebContent/Images/iconfont-rili.png new file mode 100644 index 0000000..33d0025 Binary files /dev/null and b/WebContent/Images/iconfont-rili.png differ diff --git a/WebContent/Images/iconfont-tixing.png b/WebContent/Images/iconfont-tixing.png new file mode 100644 index 0000000..a71145e Binary files /dev/null and b/WebContent/Images/iconfont-tixing.png differ diff --git a/WebContent/Images/img/Thumbs.db b/WebContent/Images/img/Thumbs.db new file mode 100644 index 0000000..e7e78e6 Binary files /dev/null and b/WebContent/Images/img/Thumbs.db differ diff --git a/WebContent/Images/img/aa.png b/WebContent/Images/img/aa.png new file mode 100644 index 0000000..3175ddf Binary files /dev/null and b/WebContent/Images/img/aa.png differ diff --git a/WebContent/Images/img/icon_top.png b/WebContent/Images/img/icon_top.png new file mode 100644 index 0000000..0cc68d3 Binary files /dev/null and b/WebContent/Images/img/icon_top.png differ diff --git a/WebContent/Images/img/icon_weibo.png b/WebContent/Images/img/icon_weibo.png new file mode 100644 index 0000000..628d718 Binary files /dev/null and b/WebContent/Images/img/icon_weibo.png differ diff --git a/WebContent/Images/img/icon_weixin.png b/WebContent/Images/img/icon_weixin.png new file mode 100644 index 0000000..875bfb0 Binary files /dev/null and b/WebContent/Images/img/icon_weixin.png differ diff --git a/WebContent/Images/img/qwe.png b/WebContent/Images/img/qwe.png new file mode 100644 index 0000000..0a7303e Binary files /dev/null and b/WebContent/Images/img/qwe.png differ diff --git a/WebContent/Images/jiesuan_dg.png b/WebContent/Images/jiesuan_dg.png new file mode 100644 index 0000000..3bf4e95 Binary files /dev/null and b/WebContent/Images/jiesuan_dg.png differ diff --git a/WebContent/Images/left1.jpg b/WebContent/Images/left1.jpg new file mode 100644 index 0000000..3833523 Binary files /dev/null and b/WebContent/Images/left1.jpg differ diff --git a/WebContent/Images/left2.jpg b/WebContent/Images/left2.jpg new file mode 100644 index 0000000..d11fe80 Binary files /dev/null and b/WebContent/Images/left2.jpg differ diff --git a/WebContent/Images/leftbg.jpg b/WebContent/Images/leftbg.jpg new file mode 100644 index 0000000..6e0e028 Binary files /dev/null and b/WebContent/Images/leftbg.jpg differ diff --git a/WebContent/Images/line_heng.jpg b/WebContent/Images/line_heng.jpg new file mode 100644 index 0000000..b5005c6 Binary files /dev/null and b/WebContent/Images/line_heng.jpg differ diff --git a/WebContent/Images/line_shu.jpg b/WebContent/Images/line_shu.jpg new file mode 100644 index 0000000..c26638c Binary files /dev/null and b/WebContent/Images/line_shu.jpg differ diff --git a/WebContent/Images/list-icon.jpg b/WebContent/Images/list-icon.jpg new file mode 100644 index 0000000..8d4164f Binary files /dev/null and b/WebContent/Images/list-icon.jpg differ diff --git a/WebContent/Images/logo-ecjtu.png b/WebContent/Images/logo-ecjtu.png new file mode 100644 index 0000000..dc38f53 Binary files /dev/null and b/WebContent/Images/logo-ecjtu.png differ diff --git a/WebContent/Images/logo.png b/WebContent/Images/logo.png new file mode 100644 index 0000000..3c662d1 Binary files /dev/null and b/WebContent/Images/logo.png differ diff --git a/WebContent/Images/logo_edumis.png b/WebContent/Images/logo_edumis.png new file mode 100644 index 0000000..4afed71 Binary files /dev/null and b/WebContent/Images/logo_edumis.png differ diff --git a/WebContent/Images/mainMenuBg.jpg b/WebContent/Images/mainMenuBg.jpg new file mode 100644 index 0000000..652f888 Binary files /dev/null and b/WebContent/Images/mainMenuBg.jpg differ diff --git a/WebContent/Images/menu.png b/WebContent/Images/menu.png new file mode 100644 index 0000000..dc146b0 Binary files /dev/null and b/WebContent/Images/menu.png differ diff --git a/WebContent/Images/notice.jpg b/WebContent/Images/notice.jpg new file mode 100644 index 0000000..4e91f92 Binary files /dev/null and b/WebContent/Images/notice.jpg differ diff --git a/WebContent/Images/notice.png b/WebContent/Images/notice.png new file mode 100644 index 0000000..f3aa7a1 Binary files /dev/null and b/WebContent/Images/notice.png differ diff --git a/WebContent/Images/opciaty.png b/WebContent/Images/opciaty.png new file mode 100644 index 0000000..6eae067 Binary files /dev/null and b/WebContent/Images/opciaty.png differ diff --git a/WebContent/Images/pay.png b/WebContent/Images/pay.png new file mode 100644 index 0000000..9aea606 Binary files /dev/null and b/WebContent/Images/pay.png differ diff --git a/WebContent/Images/pngs.png b/WebContent/Images/pngs.png new file mode 100644 index 0000000..9af8eca Binary files /dev/null and b/WebContent/Images/pngs.png differ diff --git a/WebContent/Images/progress1.png b/WebContent/Images/progress1.png new file mode 100644 index 0000000..9ed46f6 Binary files /dev/null and b/WebContent/Images/progress1.png differ diff --git a/WebContent/Images/progress2.png b/WebContent/Images/progress2.png new file mode 100644 index 0000000..f2016b5 Binary files /dev/null and b/WebContent/Images/progress2.png differ diff --git a/WebContent/Images/qa.png b/WebContent/Images/qa.png new file mode 100644 index 0000000..91ee7ba Binary files /dev/null and b/WebContent/Images/qa.png differ diff --git a/WebContent/Images/qrcodeshow.png b/WebContent/Images/qrcodeshow.png new file mode 100644 index 0000000..c07f379 Binary files /dev/null and b/WebContent/Images/qrcodeshow.png differ diff --git a/WebContent/Images/qws.png b/WebContent/Images/qws.png new file mode 100644 index 0000000..4d12ca7 Binary files /dev/null and b/WebContent/Images/qws.png differ diff --git a/WebContent/Images/school.png b/WebContent/Images/school.png new file mode 100644 index 0000000..3d401ce Binary files /dev/null and b/WebContent/Images/school.png differ diff --git a/WebContent/Images/school1.png b/WebContent/Images/school1.png new file mode 100644 index 0000000..67d3b9e Binary files /dev/null and b/WebContent/Images/school1.png differ diff --git a/WebContent/Images/searchSub.png b/WebContent/Images/searchSub.png new file mode 100644 index 0000000..9825b2e Binary files /dev/null and b/WebContent/Images/searchSub.png differ diff --git a/WebContent/Images/sj.png b/WebContent/Images/sj.png new file mode 100644 index 0000000..1405e02 Binary files /dev/null and b/WebContent/Images/sj.png differ diff --git a/WebContent/Images/smallMirror.png b/WebContent/Images/smallMirror.png new file mode 100644 index 0000000..4ece783 Binary files /dev/null and b/WebContent/Images/smallMirror.png differ diff --git a/WebContent/Images/weibo_dm_20180805_153434.mp4 b/WebContent/Images/weibo_dm_20180805_153434.mp4 new file mode 100644 index 0000000..f9643c4 Binary files /dev/null and b/WebContent/Images/weibo_dm_20180805_153434.mp4 differ diff --git a/WebContent/Images/white.jpg b/WebContent/Images/white.jpg new file mode 100644 index 0000000..36007be Binary files /dev/null and b/WebContent/Images/white.jpg differ diff --git a/WebContent/Images/wrz.png b/WebContent/Images/wrz.png new file mode 100644 index 0000000..ec0f819 Binary files /dev/null and b/WebContent/Images/wrz.png differ diff --git a/WebContent/Images/wxlogin1.jpg b/WebContent/Images/wxlogin1.jpg new file mode 100644 index 0000000..e9b7732 Binary files /dev/null and b/WebContent/Images/wxlogin1.jpg differ diff --git a/WebContent/Images/wxlogin2.png b/WebContent/Images/wxlogin2.png new file mode 100644 index 0000000..c46941d Binary files /dev/null and b/WebContent/Images/wxlogin2.png differ diff --git a/WebContent/Images/wxlogin3.png b/WebContent/Images/wxlogin3.png new file mode 100644 index 0000000..d038b05 Binary files /dev/null and b/WebContent/Images/wxlogin3.png differ diff --git a/WebContent/Images/wxlogin5.png b/WebContent/Images/wxlogin5.png new file mode 100644 index 0000000..7a78515 Binary files /dev/null and b/WebContent/Images/wxlogin5.png differ diff --git a/WebContent/Images/xg.png b/WebContent/Images/xg.png new file mode 100644 index 0000000..6688e07 Binary files /dev/null and b/WebContent/Images/xg.png differ diff --git a/WebContent/Images/xg_f.png b/WebContent/Images/xg_f.png new file mode 100644 index 0000000..c900f4b Binary files /dev/null and b/WebContent/Images/xg_f.png differ diff --git a/WebContent/Images/zc_03.jpg b/WebContent/Images/zc_03.jpg new file mode 100644 index 0000000..83422d9 Binary files /dev/null and b/WebContent/Images/zc_03.jpg differ diff --git a/WebContent/Images/zc_06.jpg b/WebContent/Images/zc_06.jpg new file mode 100644 index 0000000..7f3f86b Binary files /dev/null and b/WebContent/Images/zc_06.jpg differ diff --git a/WebContent/Images/zc_10.jpg b/WebContent/Images/zc_10.jpg new file mode 100644 index 0000000..81d33df Binary files /dev/null and b/WebContent/Images/zc_10.jpg differ diff --git a/WebContent/Images/zc_12.jpg b/WebContent/Images/zc_12.jpg new file mode 100644 index 0000000..4d91ca6 Binary files /dev/null and b/WebContent/Images/zc_12.jpg differ diff --git a/WebContent/Images/zc_15.jpg b/WebContent/Images/zc_15.jpg new file mode 100644 index 0000000..70d81d4 Binary files /dev/null and b/WebContent/Images/zc_15.jpg differ diff --git a/WebContent/Images/zc_16.jpg b/WebContent/Images/zc_16.jpg new file mode 100644 index 0000000..984399c Binary files /dev/null and b/WebContent/Images/zc_16.jpg differ diff --git a/WebContent/Images/zc_19.jpg b/WebContent/Images/zc_19.jpg new file mode 100644 index 0000000..f369d90 Binary files /dev/null and b/WebContent/Images/zc_19.jpg differ diff --git a/WebContent/Images/zc_22.jpg b/WebContent/Images/zc_22.jpg new file mode 100644 index 0000000..b680497 Binary files /dev/null and b/WebContent/Images/zc_22.jpg differ diff --git a/WebContent/Images/zc_25.jpg b/WebContent/Images/zc_25.jpg new file mode 100644 index 0000000..99e855a Binary files /dev/null and b/WebContent/Images/zc_25.jpg differ diff --git a/WebContent/ManagerLeft.jsp b/WebContent/ManagerLeft.jsp new file mode 100644 index 0000000..06bcc6e --- /dev/null +++ b/WebContent/ManagerLeft.jsp @@ -0,0 +1,79 @@ +<%-- + Created by IntelliJ IDEA. + User: Vie + Date: 2019/10/24 + Time: 16:03 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 管理员首页 + + + +
  
+ + + + + + + +
系统选项
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
后台首页
学生信息管理
宿舍公告管理
宿舍电费管理
学生入住登记
学生报修管理
修改密码
退出系统
+
+ + diff --git a/WebContent/ManagerPage.jsp b/WebContent/ManagerPage.jsp new file mode 100644 index 0000000..ef13a4d --- /dev/null +++ b/WebContent/ManagerPage.jsp @@ -0,0 +1,93 @@ +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.Date" %><%-- + Created by IntelliJ IDEA. + User: Vie + Date: 2019/10/24 + Time: 16:03 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 管理员首页 + + + +
欢迎你,<%=request.getParameter("Username")%>
+ + + + + + + + +
系统选项
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
后台首页
学生信息管理
宿舍公告管理
宿舍电费管理
学生入住登记
学生报修管理
修改密码
退出系统
+
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + diff --git a/WebContent/NoticeManage.jsp b/WebContent/NoticeManage.jsp new file mode 100644 index 0000000..eef36ee --- /dev/null +++ b/WebContent/NoticeManage.jsp @@ -0,0 +1,57 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/12/31 + Time: 12:16 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.Date" %> + + + 公告管理 + + +
欢迎你,<%=request.getParameter("Username")%>
+
+ + + + + + + + + + +
高校公寓管理系统
 
+ + + + +
+ <%@ include file="ManagerLeft.jsp"%> + + + + + + + +
公告管理
+
+
+
+
+ + +
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + diff --git a/WebContent/PasswordUpdate.jsp b/WebContent/PasswordUpdate.jsp new file mode 100644 index 0000000..6d4a731 --- /dev/null +++ b/WebContent/PasswordUpdate.jsp @@ -0,0 +1,118 @@ +<%-- + Created by IntelliJ IDEA. + User: Vie + Date: 2019/10/24 + Time: 16:03 + To change this template use File | Settings | File Templates. +--%> +<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> +<%@ page import="java.text.SimpleDateFormat" %> +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +%> + + + 修改密码 + + + + + + +
欢迎你,<%=request.getParameter("Username")%>
+
+ + + + + + + + + + + + + +
高校公寓管理系统
 
+ + + + +
+ <%@ include file="StudentLeft.jsp"%> + + + + + + + +
修改密码
+ + + + + + + + + + + + + + + + + + + + + +
  
*请输入原密码: + <%if(request.getAttribute("Msg")!=null){%> + <%=request.getAttribute("Msg")%> + <%}%>
*请输入新密码:
*请重复新密码:
 
+
 
+ +
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + + diff --git a/WebContent/PasswordUpdate2.jsp b/WebContent/PasswordUpdate2.jsp new file mode 100644 index 0000000..0bb347c --- /dev/null +++ b/WebContent/PasswordUpdate2.jsp @@ -0,0 +1,119 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/12/30 + Time: 9:50 + To change this template use File | Settings | File Templates. +--%> +<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> +<%@ page import="java.text.SimpleDateFormat" %> +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +%> +<%--<%@ taglib prefix="s" uri="/struts-tags"%>--%> +<%----%> + + + 修改密码 + + + + + + +
欢迎你,<%=request.getParameter("Username")%>
+
+ + + + + + + + + + + + + +
高校公寓管理系统
 
+ + + + +
+ <%@ include file="ManagerLeft.jsp"%> + + + + + + + +
修改密码
+ + + + + + + + + + + + + + + + + + + + + +
  
*请输入原密码: + <%if(request.getAttribute("Msg")!=null){%> + <%=request.getAttribute("Msg")%> + <%}%>
*请输入新密码:
*请重复新密码:
 
+
 
+ +
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + diff --git a/WebContent/RepairedAdd.jsp b/WebContent/RepairedAdd.jsp new file mode 100644 index 0000000..4895d35 --- /dev/null +++ b/WebContent/RepairedAdd.jsp @@ -0,0 +1,67 @@ +<%@ page import="java.util.Date" %> +<%@ page import="java.text.SimpleDateFormat" %><%-- + Created by IntelliJ IDEA. + User: 黄瑛 + Date: 2019/10/24 + Time: 16:03 + To change this template use File | Settings | File Templates. +--%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + 网上报修 + + + + + + +
欢迎你,<%=request.getParameter("Username")%>
+
+
+ +

+ +

+ +

+ +

+ + + <% + if(request.getAttribute("message")!= null){ + out.print(request.getAttribute("message")); + } + %> + + +
+ +
+
+ +
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + \ No newline at end of file diff --git a/WebContent/RepairedManage.jsp b/WebContent/RepairedManage.jsp new file mode 100644 index 0000000..e380033 --- /dev/null +++ b/WebContent/RepairedManage.jsp @@ -0,0 +1,94 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/12/30 + Time: 9:37 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@page import="java.sql.ResultSet"%> +<%@page import="java.sql.PreparedStatement"%> +<%@page import="java.sql.DriverManager"%> +<%@page import="java.sql.Connection"%> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.Date" %> + + + + + + 学生报修信息管理 + + +<% + String driver = "com.mysql.cj.jdbc.Driver"; + String url = "jdbc:mysql://localhost:3306/test?characterEncoding=utf-8" + +"&serverTimezone=GMT"+ "&useUnicode=true"+"&useSSL=false" ; + String usr = "root"; + String password = "123456"; + Class.forName("com.mysql.cj.jdbc.Driver"); + Connection conn = DriverManager.getConnection(url, usr, password); + String sqlString = "select * from repair"; + PreparedStatement pstmt = conn.prepareStatement(sqlString); + ResultSet rs = pstmt.executeQuery(); +%> +
欢迎你,<%=request.getParameter("Username")%>
+
+ + + + + + + + + + +
高校公寓管理系统
 
+ + + + +
+ <%@ include file="ManagerLeft.jsp"%> + + + + + + + + + + + <% + while (rs.next()) { + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + } + %> + + +

宿舍报修信息

报修宿舍报修时间报修类型报修电话报修结果操作
" + rs.getString("Repair_id") + "" + rs.getString("Repair_time") + "" + rs.getString("Repair_type") + "" + rs.getInt("Repair_tel") + "" + rs.getString("Repair_result") + "已修
+
+
+ +   + +
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + diff --git a/WebContent/StudentAdd.jsp b/WebContent/StudentAdd.jsp new file mode 100644 index 0000000..9ce7fb4 --- /dev/null +++ b/WebContent/StudentAdd.jsp @@ -0,0 +1,62 @@ +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.Date" %><%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/12/30 + Time: 20:48 + To change this template use File | Settings | File Templates. +--%> + + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + 添加学生信息 + + + +

请输入添加学生信息

+
+<%--
--%> + + + + + + + + + + + + + + + + + + + + +
学号:
登录密码:
姓名:
学生电话:
+ +
+
+
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + diff --git a/WebContent/StudentLeft.jsp b/WebContent/StudentLeft.jsp new file mode 100644 index 0000000..1ee2df1 --- /dev/null +++ b/WebContent/StudentLeft.jsp @@ -0,0 +1,78 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/10/24 + Time: 10:21 + To change this template use File | Settings | File Templates. +--%> +<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" %> + + + + 学生首页 + + + +
  
+ + + + + + + +
系统选项
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
后台首页
学生寝室调换
学生迁出登记
上报维修信息
查看寝室电费
修改密码
退出系统
+
+ + \ No newline at end of file diff --git a/WebContent/StudentManage.jsp b/WebContent/StudentManage.jsp new file mode 100644 index 0000000..b16782e --- /dev/null +++ b/WebContent/StudentManage.jsp @@ -0,0 +1,96 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/12/30 + Time: 8:57 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@page import="java.sql.ResultSet"%> +<%@page import="java.sql.PreparedStatement"%> +<%@page import="java.sql.DriverManager"%> +<%@page import="java.sql.Connection"%> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.Date" %> + + + + + + 学生信息管理 + + +<% + String driver = "com.mysql.cj.jdbc.Driver"; + String url = "jdbc:mysql://localhost:3306/test?characterEncoding=utf-8" + +"&serverTimezone=GMT"+ "&useUnicode=true"+"&useSSL=false" ; + String usr = "root"; + String password = "123456"; + Class.forName("com.mysql.cj.jdbc.Driver"); + Connection conn = DriverManager.getConnection(url, usr, password); + String sqlString = "select * from admin"; + PreparedStatement pstmt = conn.prepareStatement(sqlString); + ResultSet rs = pstmt.executeQuery(); +%> +
欢迎你,<%=request.getParameter("Username")%>
+
+ + + + + + + + + + +
高校公寓管理系统
 
+ + + + +
+ <%@ include file="ManagerLeft.jsp"%> + + + + + + + + + + <% + while (rs.next()) { + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + } + %> +
+ +
+
+ + +

学生基本信息

学号登陆密码姓名电话操作
" + rs.getInt("Admin_id") + "" + rs.getString("Admin_password") + "" + rs.getString("Admin_name") + "" + rs.getString("Admin_tel") + "删除
+
+
+ +   + +
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + diff --git a/WebContent/StudentPage.jsp b/WebContent/StudentPage.jsp new file mode 100644 index 0000000..a9ccf05 --- /dev/null +++ b/WebContent/StudentPage.jsp @@ -0,0 +1,92 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/10/24 + Time: 10:21 + To change this template use File | Settings | File Templates. +--%> +<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" %> +<%@ page import="java.text.SimpleDateFormat" %> + + + + 学生首页 + + + +
欢迎你,<%=request.getParameter("Username")%>
+ + + + + + + + +
系统选项
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
后台首页
学生寝室调换
学生迁出登记
上报维修信息
查看寝室电费
修改密码
退出系统
+
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + \ No newline at end of file diff --git a/WebContent/WEB-INF/lib/.idea/lib.iml b/WebContent/WEB-INF/lib/.idea/lib.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/WebContent/WEB-INF/lib/.idea/lib.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/lib/.idea/misc.xml b/WebContent/WEB-INF/lib/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/WebContent/WEB-INF/lib/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/lib/.idea/modules.xml b/WebContent/WEB-INF/lib/.idea/modules.xml new file mode 100644 index 0000000..b0c4ff6 --- /dev/null +++ b/WebContent/WEB-INF/lib/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/lib/.idea/workspace.xml b/WebContent/WEB-INF/lib/.idea/workspace.xml new file mode 100644 index 0000000..db27576 --- /dev/null +++ b/WebContent/WEB-INF/lib/.idea/workspace.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + 1576286661953 + + + + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index b1a96e4..84002d5 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -1,16 +1,31 @@ - - demo - - - - Test - cn.demo.Test + + + StudentServlet + com.demo.StudentServlet + + - Test - - /Test + StudentServlet + /addStudent.jsp - + + + /addStudent.jsp + + + + addServlet + com.action.addServlet + + + + addServlet + /StudentAdd.jsp + + \ No newline at end of file diff --git a/WebContent/addStudent.jsp b/WebContent/addStudent.jsp new file mode 100644 index 0000000..ce87ae1 --- /dev/null +++ b/WebContent/addStudent.jsp @@ -0,0 +1,99 @@ +<%-- + Created by IntelliJ IDEA. + User: MaCong + Date: 2019/10/24 + Time: 10:04 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.*" pageEncoding="UTF-8"%> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.Date" %> + +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +%> + + + +
  
+ + + + 用户登录 + + + + + + + +
+
+ + + + + + + + + + +
高校学生公寓管理系统
 
+ + +
+ + + + + + + + + + + + + + + + + +
  
用户名:
密码:
 
+
+ + + + +   + + + +
+
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + diff --git a/WebContent/index.jsp b/WebContent/index.jsp new file mode 100644 index 0000000..43717b4 --- /dev/null +++ b/WebContent/index.jsp @@ -0,0 +1,152 @@ +<%-- + Created by IntelliJ IDEA. + User: vie + Date: 2019/10/24 + Time: 10:21 + To change this template use File | Settings | File Templates. +--%> +<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" %> +<%@ page import="java.text.SimpleDateFormat" %> + + + + 学生首页 + + + +<%----%> + +

想拥有这样的

+

大学校友吗??

+
  
+ + + + + + + + +
系统选项
+ + + + + + + + + <%-- <%– <%if(session.getAttribute("type").toString().equals("1")){%>–%>--%> + <%-- --%> + <%-- <%– –%>--%> + <%-- --%> + <%-- + + + <%-- --%> + <%-- --%> + <%-- --%> + + + + + + + + + + + + + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- <%– –%>--%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- <%– –%>--%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- <%}%>--%> + <%-- <%if(session.getAttribute("type").toString().equals("2")){%>--%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- <%– –%>--%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- --%> + <%-- <%– <%}%>–%>--%> + <%-- <%– <%if(session.getAttribute("type").toString().equals("3")){%>–%>--%> + <%-- --%> + <%-- <%– –%>--%> + <%-- --%> + + + + + + + + + + + <%-- --%> + + + + + + + + <%-- <%}%>--%> + + + + + + + + + + +
后台首页
楼宇管理员管理
后台首页
学生寝室调换
学生迁出登记
学生缺寝记录
迁出记录
学生管理
学生缺寝记录
我的缺寝记录
上报维修信息
我的维修记录
查看寝室电费
修改密码
退出系统
+
+
+ <%!Date time= new Date();%> + <% + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒"); + %> +

<% out.println(sdf1.format(time)); %>

+
+ + \ No newline at end of file diff --git a/lib/JDBCtest.jar b/lib/JDBCtest.jar new file mode 100644 index 0000000..d92a671 Binary files /dev/null and b/lib/JDBCtest.jar differ diff --git a/lib/commons-fileupload-1.2.2.jar b/lib/commons-fileupload-1.2.2.jar new file mode 100644 index 0000000..131f192 Binary files /dev/null and b/lib/commons-fileupload-1.2.2.jar differ diff --git a/lib/commons-io-2.0.1.jar b/lib/commons-io-2.0.1.jar new file mode 100644 index 0000000..5b64b7d Binary files /dev/null and b/lib/commons-io-2.0.1.jar differ diff --git a/lib/commons-lang3-3.1.jar b/lib/commons-lang3-3.1.jar new file mode 100644 index 0000000..a85e539 Binary files /dev/null and b/lib/commons-lang3-3.1.jar differ diff --git a/lib/commons-lang3-3.9-sources.jar b/lib/commons-lang3-3.9-sources.jar new file mode 100644 index 0000000..78ea8e4 Binary files /dev/null and b/lib/commons-lang3-3.9-sources.jar differ diff --git a/lib/commons-lang3-3.9-test-sources.jar b/lib/commons-lang3-3.9-test-sources.jar new file mode 100644 index 0000000..8c80d6f Binary files /dev/null and b/lib/commons-lang3-3.9-test-sources.jar differ diff --git a/lib/commons-lang3-3.9-tests.jar b/lib/commons-lang3-3.9-tests.jar new file mode 100644 index 0000000..322fe7a Binary files /dev/null and b/lib/commons-lang3-3.9-tests.jar differ diff --git a/lib/commons-lang3-3.9.jar b/lib/commons-lang3-3.9.jar new file mode 100644 index 0000000..0d89693 Binary files /dev/null and b/lib/commons-lang3-3.9.jar differ diff --git a/lib/commons-logging-1.1.1.jar b/lib/commons-logging-1.1.1.jar new file mode 100644 index 0000000..1deef14 Binary files /dev/null and b/lib/commons-logging-1.1.1.jar differ diff --git a/lib/freemarker-2.3.19.jar b/lib/freemarker-2.3.19.jar new file mode 100644 index 0000000..b13671d Binary files /dev/null and b/lib/freemarker-2.3.19.jar differ diff --git a/lib/jackson-mapper-asl-1.9.2.jar b/lib/jackson-mapper-asl-1.9.2.jar new file mode 100644 index 0000000..6407dc0 Binary files /dev/null and b/lib/jackson-mapper-asl-1.9.2.jar differ diff --git a/lib/javassist-3.11.0.GA.jar b/lib/javassist-3.11.0.GA.jar new file mode 100644 index 0000000..b3bfeeb Binary files /dev/null and b/lib/javassist-3.11.0.GA.jar differ diff --git a/lib/jsp-api.jar b/lib/jsp-api.jar new file mode 100644 index 0000000..23854cc Binary files /dev/null and b/lib/jsp-api.jar differ diff --git a/lib/jstl.jar b/lib/jstl.jar new file mode 100644 index 0000000..a02abec Binary files /dev/null and b/lib/jstl.jar differ diff --git a/lib/mysql-connector-java-3.1.12-bin.jar b/lib/mysql-connector-java-3.1.12-bin.jar new file mode 100644 index 0000000..3148a35 Binary files /dev/null and b/lib/mysql-connector-java-3.1.12-bin.jar differ diff --git a/lib/mysql-connector-java-8.0.11.jar b/lib/mysql-connector-java-8.0.11.jar new file mode 100644 index 0000000..c3b5f70 Binary files /dev/null and b/lib/mysql-connector-java-8.0.11.jar differ diff --git a/lib/ognl-3.0.6.jar b/lib/ognl-3.0.6.jar new file mode 100644 index 0000000..b0838b7 Binary files /dev/null and b/lib/ognl-3.0.6.jar differ diff --git a/lib/servlet-api.jar b/lib/servlet-api.jar new file mode 100644 index 0000000..018a2a3 Binary files /dev/null and b/lib/servlet-api.jar differ diff --git a/lib/standard.jar b/lib/standard.jar new file mode 100644 index 0000000..bc528ac Binary files /dev/null and b/lib/standard.jar differ diff --git a/lib/struts2-core-2.3.8.jar b/lib/struts2-core-2.3.8.jar new file mode 100644 index 0000000..8779ef1 Binary files /dev/null and b/lib/struts2-core-2.3.8.jar differ diff --git a/lib/xwork-core-2.3.8.jar b/lib/xwork-core-2.3.8.jar new file mode 100644 index 0000000..0fbec5b Binary files /dev/null and b/lib/xwork-core-2.3.8.jar differ diff --git a/src/com/action/DeleteServlet.java b/src/com/action/DeleteServlet.java new file mode 100644 index 0000000..1a5c625 --- /dev/null +++ b/src/com/action/DeleteServlet.java @@ -0,0 +1,60 @@ +package com.action; + + +//这里是源包里的p1包中的deleteServlet + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +public class DeleteServlet extends HttpServlet { + + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + String driver="com.mysql.jdbc.Driver"; + String url="jdbc:mysql://localhost:3306/test?characterEncoding=utf-8" + + "&serverTimezone=UTC"; + String usr="root"; + String password="123456"; + try{ + Class.forName(driver); + Connection conn=DriverManager.getConnection(url,usr,password); + String sqlString="delete from admin where Admin_id=?"; + PreparedStatement pstmt=conn.prepareStatement(sqlString); + int id =Integer.parseInt(request.getParameter("Admin_id")); + pstmt.setInt(1, id); + pstmt.execute(); + }catch(Exception e){ + System.err.println("error:"+e); + } + response.sendRedirect("StudentManage.jsp"); + } + } + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + @Override + public String getServletInfo() { + return "Short description"; + } + +} diff --git a/src/com/action/StudentBean.java b/src/com/action/StudentBean.java new file mode 100644 index 0000000..06b2e3c --- /dev/null +++ b/src/com/action/StudentBean.java @@ -0,0 +1,95 @@ +package com.action; + +public class StudentBean { + private int Student_ID ; + private int Student_DomitoryID ; + private String Student_Username ; + private String Student_Password ; + private String Student_Name ; + private String Student_Sex ; + private String Student_Class ; + private String Student_State ; + public int getStudent_ID() { + return Student_ID; + } + public void setStudent_ID(int studentID) { + Student_ID = studentID; + } + public int getStudent_DomitoryID() { + return Student_DomitoryID; + } + public void setStudent_DomitoryID(int studentDomitoryID) { + Student_DomitoryID = studentDomitoryID; + } + public String getStudent_Username() { + return Student_Username; + } + public void setStudent_Username(String studentUsername) { + Student_Username = studentUsername; + } + public String getStudent_Password() { + return Student_Password; + } + public void setStudent_Password(String studentPassword) { + Student_Password = studentPassword; + } + public String getStudent_Name() { + return Student_Name; + } + public void setStudent_Name(String studentName) { + Student_Name = studentName; + } + public String getStudent_Sex() { + return Student_Sex; + } + public void setStudent_Sex(String studentSex) { + Student_Sex = studentSex; + } + public String getStudent_Class() { + return Student_Class; + } + public void setStudent_Class(String studentClass) { + Student_Class = studentClass; + } + public String getStudent_State() { + return Student_State; + } + public void setStudent_State(String studentState) { + Student_State = studentState; + } + private String Domitory_Name ; + private String Building_Name ; + public String getDomitory_Name() { + return Domitory_Name; + } + public void setDomitory_Name(String domitoryName) { + Domitory_Name = domitoryName; + } + public String getBuilding_Name() { + return Building_Name; + } + public void setBuilding_Name(String buildingName) { + Building_Name = buildingName; + } + private String Domitory_Type ; + private String Domitory_Number ; + private String Domitory_Tel ; + public String getDomitory_Type() { + return Domitory_Type; + } + public void setDomitory_Type(String domitoryType) { + Domitory_Type = domitoryType; + } + public String getDomitory_Number() { + return Domitory_Number; + } + public void setDomitory_Number(String domitoryNumber) { + Domitory_Number = domitoryNumber; + } + public String getDomitory_Tel() { + return Domitory_Tel; + } + public void setDomitory_Tel(String domitoryTel) { + Domitory_Tel = domitoryTel; + } +} diff --git a/src/com/action/addServlet.java b/src/com/action/addServlet.java new file mode 100644 index 0000000..2bb83ac --- /dev/null +++ b/src/com/action/addServlet.java @@ -0,0 +1,66 @@ +package com.action; + +//这里是源包里的p1包中的addServlet +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +//@WebServlet(name="addServlet",urlPatterns = {"StudentAdd.jsp"}) +public class addServlet extends HttpServlet { + + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + String driver="com.mysql.jdbc.Driver"; + String url="jdbc:mysql://localhost:3306/test?characterEncoding=utf-8" + + "&serverTimezone=UTC"; + String usr="root"; + String password="123456"; + try{ + Class.forName(driver); + Connection conn=DriverManager.getConnection(url,usr,password); + String sqlString="INSERT INTO admin (Admin_id, Admin_password, Admin_name, Admin_tel)" + + "VALUES ( ?, ?, ?, ? )"; + PreparedStatement pstmt=conn.prepareStatement(sqlString); + int id = Integer.parseInt(request.getParameter("adminid")); + String pass = request.getParameter("adminpass"); + String name = request.getParameter("adminname"); + String tel = request.getParameter("admintel"); + pstmt.setInt(1, id); + pstmt.setString(2, pass); + pstmt.setString(3, name); + pstmt.setString(4,tel ); + pstmt.execute(); + }catch(Exception e){ + System.err.println("error:"+e); + } + response.sendRedirect("StudentManage.jsp"); + } + } + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + @Override + public String getServletInfo() { + return "Short description"; + } + +} diff --git a/src/com/dao/BaseDao.java b/src/com/dao/BaseDao.java new file mode 100644 index 0000000..be7670c --- /dev/null +++ b/src/com/dao/BaseDao.java @@ -0,0 +1,45 @@ +package com.dao; +import java.sql.Connection; + +import java.sql.*; + +public class BaseDao { + + /* + * + * @param + * @return connection the connection of MySQL + * @return null when get failed + */ + public Connection getConnection(){ + + String username= "root" ; + String password = "123456"; + + String driver = "com.mysql.cj.jdbc.Driver" ; + //String url = "jdbc:mysql://127.0.0.1:3306/test"; + String url="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT"; + + try{ + Class.forName("com.mysql.cj.jdbc.Driver"); + System.out.println("ok"); + Connection connection = DriverManager.getConnection(url, username, password); + return connection; + }catch(Exception e){ + System.out.println(e); + } + return null ; + } + + + + public static void main(String[] args) { + + Connection conn = new BaseDao().getConnection(); + if(conn != null){ + System.out.println(conn); + } + } + + +} diff --git a/src/com/dao/StudentDao.java b/src/com/dao/StudentDao.java new file mode 100644 index 0000000..2c4e2bd --- /dev/null +++ b/src/com/dao/StudentDao.java @@ -0,0 +1,8 @@ +package com.dao; +import java.util.*; + +import com.demo.Student; +public interface StudentDao { + public Student listStudent(String password); + +} diff --git a/src/com/dao/StudentDaoImpl.java b/src/com/dao/StudentDaoImpl.java new file mode 100644 index 0000000..d3bd4ac --- /dev/null +++ b/src/com/dao/StudentDaoImpl.java @@ -0,0 +1,40 @@ +package com.dao; +import java. util. * ; +import java.sql. * ; +//import java.sql.DriverManager; +import com. demo. Student; +import org.apache.commons.lang3.ObjectUtils; +public class StudentDaoImpl extends BaseDao implements StudentDao{ + Connection conn = getConnection( ); + public Student listStudent (String password){ + + String sql = "SELECT * FROM student WHERE Student_id=?"; + + Student s = new Student(); + try { + + PreparedStatement pst = null; + pst = conn.prepareStatement(sql); + ResultSet rs = pst.executeQuery(); + + while (rs.next()) { + String password_ret=rs.getString("Student_password"); + //if(password_ret!= null&&password_ret.equals(password)){ + int id = rs.getInt("id"); + String name = rs.getString("Student_name"); + String sex = rs.getString("Student_sex"); + String domitory = rs.getString("Student_domitory"); + //Student s = new Student(id,name,sex,password,domitory); + s.setId(id); + s.setName(name); + s.setSex(sex); + s.setDomitory(domitory); + System.out.print("exist"); + } + } catch (SQLException sqle) { + System.out.println(sqle); + return s; + } + return s; + } +} diff --git a/src/com/demo/Student.java b/src/com/demo/Student.java new file mode 100644 index 0000000..7fec9d9 --- /dev/null +++ b/src/com/demo/Student.java @@ -0,0 +1,30 @@ +package com.demo; + +public class Student { + private int id=0; + private String name=null; + private String sex=null; + private String password=null; + private String domitory=null; + + public Student(int id,String name,String sex ,String password,String domitory){ + this.id= id; + this.name=name; + this.sex= sex; + this.password=password; + this.domitory=domitory; + } + public Student(){} + + + public int getId(){return this.id;} + public String getName(){return this.name;} + public String getSex(){return this.sex;} + public String getPassword(){return this.password;} + public String getDomitory(){return this.domitory;} + public void setDomitory(String domitory){this.domitory=domitory;} + public void setId(int id){this.id=id;} + public void setName(String name){this.name=name;} + public void setSex(String age){this.sex=age;} + public void setPassword(String email){this.password=email;} +} diff --git a/src/com/demo/StudentServlet.java b/src/com/demo/StudentServlet.java new file mode 100644 index 0000000..09e9ea2 --- /dev/null +++ b/src/com/demo/StudentServlet.java @@ -0,0 +1,57 @@ +package com.demo; + +import com.dao.StudentDao; +import com.dao.StudentDaoImpl; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.*; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@ WebServlet(name = "StudentServlet", urlPatterns = { "/addStudent.jsp" }) +public class StudentServlet extends HttpServlet { + + private static final long serialVersionUID = 1L; + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String username = request.getParameter("username" ); + String password =request.getParameter("password"); +// System.out.print("ok2"); + //检索信息正确 + listStudent(request,response); + RequestDispatcher rd = request.getRequestDispatcher("StudentPage.jsp"); + rd.forward(request, response); + } + + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + doPost(request, response); + } + + //添加学生方法 + public void listStudent(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException { + StudentDao dao = new StudentDaoImpl(); + String username = request.getParameter("username" ); + String password =request.getParameter("password"); + Student student = dao.listStudent(password); + } + + public void removeStudent( HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException { + + } + + + public void addStudent( HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException { + + } +}