校园社团活动管理系统

1、项目需求:

校园社团作为高校课外活动的重要组成部分,发展十分迅速,也受到越来越多学生的欢迎,社团规模、数量等都在日益增长,社团活动也更为多样和丰富。然而,大多数高校还没有一个完整成熟的社团管理系统,仅仅是靠人力来管理,导致效率低下,而学生也只能通过线下或者公众号的方式了解社团,另外,社团活动的通知方式也很杂乱,并没有一个信息聚合、消息发布的平台。

因此,高校有必要建立一个校园社团管理系统,使得社团管理工作规范化、系统化、程序化、科学化,提高管理工作的效率。

2.系统要求与功能设计

2.1 页面功能要求

1)能够在Tomcat服务器中正确部署,并通过浏览器查看;

2)网站页面整体风格统一;

 

1 活动普查系统功能结构图

3)主页面:要求显示发布活动信息、修改活动信息、删除活动信息、查询活动信息,活动信息浏览五个子菜单。

4)发布活动信息页面:

①完成添加活动信息发布,基本信息和填报限制如下表所示

活动主题

字符串(不超过20个汉字)

活动目的

字符串(不超过50个汉字)

活动类型

社团竞赛、野外采风、校内集会、社团纳新(单选框)

活动时间

文本框

活动地点

文本框

活动对象

社团成员、全体学生(复选框实现)

活动内容

(文本框,不超过500个汉字)

活动日程安排

(文本框,不超过500个汉字)

 

点击“提交”按钮,保存成功则跳转到活动基本信息浏览界面,新录入的信息置顶显示。失败则提示错误信息,返回当前页面

5)修改活动信息页面:

输入活动主题,显示其余信息,可对活动目的、活动类型、活动时间、活动地点、活动对象、活动内容、活动日程安排进行修改。(活动目的、活动类型、活动时间、活动地点、活动对象、活动内容、活动日程安排必须符合录入要求);如果该活动主题数据库不存在,则提示“该活动不存在”。

6)删除活动信息页面:录入活动主题,显示详细信息后,点击“删除”按钮,弹出提示框,提示“是否确认删除该活动信息”,确认后删除该信息。

7)浏览活动信息页面:

以列表形式显示活动基本信息,结果列表中显示活动主题、活动时间,活动类型、活动对象基本信息,点击主题,可以跳转到活动详细信息,显示全部活动信息。

① 实现以列表形式显示活动基本信息,结果列表中显示活动主题、活动时间,活动类型、活动对象基本信息

②实现跳转活动详细信息页面,显示全部活动信息。

8)查询活动信息页面:

要求根据活动主题、活动时间、活动类型、活动地点四种条件实现模糊查询,输出结果以列表形式显示,显示显示活动主题、活动时间,活动类型、活动对象基本信息,点击列表中的活动主题,跳转到活动详细信息页面。

2.2 功能要求

1)设计出合理的数据库和数据表,要求使用mysql、sqlserver、oracle三种数据库中一种

2)使用Serverlet实现页面交互

3)使用Java Bean封装数据库连接操作

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package Bean;
 
public class bean {
private String zhuti;
private String mudi;
private String huodongleixing;
private String time;
private String didian;
private String duixiang;
private String neirong;
private String richenganpai;
public String getZhuti() {
    return zhuti;
}
public void setZhuti(String zhuti) {
    this.zhuti = zhuti;
}
public String getMudi() {
    return mudi;
}
public void setMudi(String mudi) {
    this.mudi = mudi;
}
public String getHuodongleixing() {
    return huodongleixing;
}
public void setHuodongleixing(String huodongleixing) {
    this.huodongleixing = huodongleixing;
}
public String getTime() {
    return time;
}
public void setTime(String time) {
    this.time = time;
}
public String getDidian() {
    return didian;
}
public void setDidian(String didian) {
    this.didian = didian;
}
public String getDuixiang() {
    return duixiang;
}
public void setDuixiang(String duixiang) {
    this.duixiang = duixiang;
}
public String getNeirong() {
    return neirong;
}
public void setNeirong(String neirong) {
    this.neirong = neirong;
}
public String getRichenganpai() {
    return richenganpai;
}
public void setRichenganpai(String richenganpai) {
    this.richenganpai = richenganpai;
}
public bean(String zhuti, String mudi, String huodongleixing, String time, String didian, String duixiang,
        String neirong, String richenganpai) {
    super();
    this.zhuti = zhuti;
    this.mudi = mudi;
    this.huodongleixing = huodongleixing;
    this.time = time;
    this.didian = didian;
    this.duixiang = duixiang;
    this.neirong = neirong;
    this.richenganpai = richenganpai;
}
public bean() {
    super();
}
 
 
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
package Dao;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
 
import Bean.bean;
import util.DBUtil;
public class Dao {
    public boolean add(bean bean) {
        String sql = "insert into huodong(zhuti,mudi,huodongleixing,time,didian,duixiang,neirong,richenganpai) values('" + bean.getZhuti() + "','" + bean.getMudi() + "','" + bean.getHuodongleixing() + "','" + bean.getTime() + "','" + bean.getDidian() + "','" + bean.getDuixiang() + "','" + bean.getNeirong() + "','" + bean.getRichenganpai() + "')";
        //创建数据库链接
        Connection conn = DBUtil.getConn();
        Statement state = null;
        boolean f = false;
        int a = 0;
 
        try {
        state = conn.createStatement();
        a = state.executeUpdate(sql);
        } catch (Exception e) {
        e.printStackTrace();
        } finally {
        //关闭连接
        DBUtil.close(state, conn);
        }
        if (a > 0) {
            f = true;
            }
            return f;
            }
    public boolean leibie(String zhuti) {
        boolean flag = false;
        String sql = "select name from huodong where name = '" + zhuti + "'";
        Connection conn = DBUtil.getConn();
        Statement state = null;
        ResultSet rs = null;
 
        try {
        state = conn.createStatement();
        rs = state.executeQuery(sql);
        while (rs.next()) {
        flag = true;
        }
        } catch (SQLException e) {
        e.printStackTrace();
        } finally {
        DBUtil.close(rs, state, conn);
        }
        return flag;
        }
     
    public int delete (String zhuti) {
         
        String sql = "DELETE from huodong WHERE zhuti like '%"+zhuti+"%'";
        Connection conn = DBUtil.getConn();
        Statement state = null;
        int a = 0;
 
        try {
        state = conn.createStatement();
        a = state.executeUpdate(sql);
        } catch (SQLException e) {
        e.printStackTrace();
        } finally {
        DBUtil.close(state, conn);
        }
 
        return a;
        }
     
    public bean getByName(String name) {
        String sql = "select * from huodong where zhuti ='" + name + "'";
        Connection conn = DBUtil.getConn();
        Statement state = null;
        ResultSet rs = null;
        bean bean = null;
        try {
        state = conn.createStatement();
        rs = state.executeQuery(sql);
        while (rs.next()) {
            String zhuti =rs.getString("zhuti");
            String mudi = rs.getString("mudi");
            String huodongleixing = rs.getString("huodongleixing");
            String time = rs.getString("time");
            String didian = rs.getString("didian");
            String duixiang = rs.getString("duixiang");
            String neirong = rs.getString("neirong");
            String richenganpai = rs.getString("richenganpai");
         bean = new bean(zhuti,mudi,huodongleixing,time,didian,duixiang,neirong,richenganpai);
        }
        } catch (Exception e) {
        e.printStackTrace();
        } finally {
        DBUtil.close(rs, state, conn);
        }
 
        return bean;
    }
    public bean getBy(String didian,String zhuti,String shijain,String leixing) {
        String sql = "select * from huodong where didian like '%" + didian+ "%'or zhuti like'%"+zhuti+" %'or time like'%"+shijain+" %' or huodongleixing like'%"+leixing+"%'";
        Connection conn = DBUtil.getConn();
        Statement state = null;
        ResultSet rs = null;
        bean bean= null;
 
        try {
            state = conn.createStatement();
            rs = state.executeQuery(sql);
            while (rs.next()) {
                String zhuti1 = rs.getString("zhuti");
                String didian1 = rs.getString("didian");
                String mudi1 = rs.getString("mudi");
                String time1 = rs.getString("time");
                String huodongleixing1= rs.getString("huodongleixing");
                String duixiang1 = rs.getString("duixiang");
                String neirong1 = rs.getString("neirong");
                String richenganpai1 = rs.getString("richenganpai");
 
                bean = new bean(zhuti1,mudi1,huodongleixing1,time1,didian1,duixiang1,neirong1,richenganpai1);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            DBUtil.close(rs, state, conn);
        }
 
        return bean;
    }
     
    public ArrayList<bean> list() {
        String sql = "select * from huodong";
        ArrayList<bean> list = new ArrayList<>();
        Connection conn = DBUtil.getConn();
        Statement state = null;
        ResultSet rs = null;
 
        try {
            state = conn.createStatement();
            rs = state.executeQuery(sql);
            bean bean = null;
            while (rs.next()) {
//int id = Integer.parseInt(rs.getString("id"));
                String zhuti =rs.getString("zhuti");
                String mudi = rs.getString("mudi");
                String huodongleixing = rs.getString("huodongleixing");
                String time = rs.getString("time");
                String didian = rs.getString("didian");
                String duixiang = rs.getString("duixiang");
                String neirong = rs.getString("neirong");
                String richenganpai = rs.getString("richenganpai");
                bean = new bean(zhuti,mudi,huodongleixing,time,didian,duixiang,neirong,richenganpai);
                list.add(bean);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            DBUtil.close(rs, state, conn);
        }
        return list;
 
}
}

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package Service;
 
import java.util.ArrayList;
import java.util.List;
 
import Dao.Dao;
import Bean.bean;
 
/**
* Service
* 服务层
* @author Hu
*
*/
public class Service {
 
Dao cDao = new Dao();
 
/**
* 添加
* @param course
* @return
*/
public boolean add(bean bean) {
boolean f = false;
if(!cDao.leibie(bean.getZhuti())) {
cDao.add(bean);
f = true;
}
return f;
}
 
public int del(String zhuti) {
     
int i=cDao.delete(zhuti);
System.out.println(i);
return i;
}
 
public bean getBy(String didian,String zhuti,String shijain,String leixing){
    return cDao.getBy( didian,zhuti,shijain, leixing);
}
public bean getByName(String zhuti) {
    //cDao.delete(name);
    return cDao.getByName(zhuti);
}
public ArrayList<bean> list() {
    return cDao.list();
}
}

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
package Servlet;
 
import java.io.IOException;
import java.util.ArrayList;
 
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import Bean.bean;
import Service.Service;
 
@WebServlet("/Servlet")
public class Servlet extends HttpServlet {
 
private static final long serialVersionUID = 1L;
 
Service service = new Service();
 
/**
* 方法选择
*/
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
String method = req.getParameter("method");
 
if ("add".equals(method))
{
    try {
        add(req,resp);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
if ("del".equals(method))
{
    try {
        del(req,resp);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
if ("search".equals(method))
{
    try {
        search(req,resp);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
if ("update".equals(method))
{
    try {
        update(req,resp);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
if ("liulan".equals(method))
{
    try {
        liulan(req,resp);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
if ("getbyname".equals(method))
{
    try {
        getbyname(req,resp);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
}
/**
* 添加
* @param req
* @param resp
* @throws IOException
* @throws ServletException
*/
private void add(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
req.setCharacterEncoding("utf-8");
//获取数据
String zhuti = req.getParameter("zhuti");
String mudi = req.getParameter("mudi");
String huodongleixing = "";
if(req.getParameter("huodongleixing")!=null)
huodongleixing=req.getParameter("huodongleixing");
String time = req.getParameter("time");
String didian = req.getParameter("didian");
String duixiang1 = req.getParameter("duixiang1");
String duixiang2 = req.getParameter("duixiang2");
String duixiang = "";
if(duixiang1!=null)
duixiang+=duixiang1;
if(duixiang2!=null)
duixiang+=duixiang2;
String neirong = req.getParameter("neirong");
String richenganpai = req.getParameter("richenganpai");
 
bean bean = new bean(zhuti,mudi,huodongleixing,time,didian,duixiang,neirong,richenganpai);
 
//添加后消息显示
if(service.add(bean)) {
req.setAttribute("message", "添加成功");
bean bean1=service.getBy(didian,zhuti,time,huodongleixing);
req.setAttribute("bean", bean1);
req.getRequestDispatcher("List.jsp").forward(req,resp);
} else {
req.setAttribute("message", "添加失败,请重新录入");
req.getRequestDispatcher("add.jsp").forward(req,resp);
}
}
 
private void del(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
    req.setCharacterEncoding("utf-8");
    String zhuti = req.getParameter("zhuti");
 
    service.del(zhuti);
    req.setAttribute("message", "删除成功!");
    req.getRequestDispatcher("del.jsp").forward(req,resp);
}
 
private void getbyname(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
req.setCharacterEncoding("utf-8");
String zhuti = req.getParameter("zhuti");
System.out.println(zhuti);
req.setCharacterEncoding("utf-8");
bean bean=service.getByName(zhuti);
if(bean == null) {
    req.setAttribute("message", "查无此人!");
    req.getRequestDispatcher("del.jsp").forward(req,resp);
} else {
    req.setAttribute("bean", bean);
    req.getRequestDispatcher("del1.jsp").forward(req,resp);
}
}
 
private void search(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
    req.setCharacterEncoding("utf-8");
//获取数据
 
    String zhuti = req.getParameter("zhuti");
    String huodongleixing = req.getParameter("huodongleixing");
    String time = req.getParameter("time");
    String didian= req.getParameter("didian");
    bean bean=service.getBy(didian,zhuti,time,huodongleixing);
    req.setAttribute("bean", bean);
    req.getRequestDispatcher("List.jsp").forward(req,resp);
 
}
 
private void update(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
//    req.setCharacterEncoding("utf-8");
//    String zhuti = req.getParameter("zhuti");
//    bean bean=service.getByName(zhuti);
//    if(bean == null) {
//        req.setAttribute("message", "查无此人!");
//        req.getRequestDispatcher("del.jsp").forward(req,resp);
//    } else {
//        req.setAttribute("bean", bean);
//        req.getRequestDispatcher("detail.jsp").forward(req,resp);
//    }
    req.setCharacterEncoding("utf-8");
    String zhuti = req.getParameter("zhuti");
    bean bean=service.getByName(zhuti);
    req.setAttribute("bean", bean);
    req.getRequestDispatcher("detail.jsp").forward(req,resp);
}
 
private void liulan(HttpServletRequest req,HttpServletResponse resp)throws IOException,ServletException
{
    req.setCharacterEncoding("utf-8");
    ArrayList<bean> list= service.list();
//    list= service.list();
    req.setAttribute("list",list);
 
 
 
    req.getRequestDispatcher("liulan1.jsp").forward(req,resp);
}
}

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package util;
import java.sql.*;
public class DBUtil {
    static final String JDBC_DRIVER = "com.mysql.cj.jdbc.Driver";
    static final String DB_URL = "jdbc:mysql://localhost:3306/shetuanhuodong?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC";
    static final String USER = "root";
    static final String PASS = "123456";
    public static Connection getConn () {
    Connection conn = null;
    try {
          Class.forName(JDBC_DRIVER);  
          System.out.println("连接数据库...");
          conn = DriverManager.getConnection(DB_URL,USER,PASS);
    } catch (Exception e) {
    e.printStackTrace();
    }
    return conn;
    }
    //statement
    public static void close (Statement state, Connection conn) {
         
        if (state != null) {
        try {
        state.close();
        } catch (SQLException e) {
        e.printStackTrace();
        }
        }
 
        if (conn != null) {
        try {
        conn.close();
        } catch (SQLException e) {
        e.printStackTrace();
        }
        }
        }
    public static void close (ResultSet rs, Statement state, Connection conn) {
        if (rs != null) {
        try {
        rs.close();
        } catch (SQLException e) {
        e.printStackTrace();
        }
        }
 
        if (state != null) {
        try {
        state.close();
        } catch (SQLException e) {
        e.printStackTrace();
        }
        }
 
        if (conn != null) {
        try {
        conn.close();
        } catch (SQLException e) {
        e.printStackTrace();
        }
        }
        }
         
 
     
 
     
     
}

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>发布活动信息</title>
 
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
 
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: black;">发布活动信息</h1>
<a href="Screen.jsp">返回主页</a>
<form name="form1" action="Servlet?method=add" method="post" onsubmit="return check()">
<div class="a">
            活动主题<input type="text" id="zhuti" name="zhuti" />
        </div>
        <div class="a">
            活动目的<input type="text" id="mudi" name="mudi" />
        </div>
 
        <div class="a">
            活动类型
            社团竞赛<input type="radio" name="huodongleixing" value="社团竞赛" >
            野外采风<input type="radio"name="huodongleixing" value="野外采风" >
            校内集会<input type="radio"name="huodongleixing" value="校内集会" >
            社团纳新<input type="radio"name="huodongleixing" value="社团纳新" >
        </div>
        <div class="a">
            活动时间<input type="text" id="time" name="time" />
        </div>
        <div class="a">
            活动地点<input type="text" id="didian" name="didian" />
        </div>
        <div class="a">
            活动对象:
            <label>
           <input type="checkbox" name="duixiang1" value="社团人员" />社团人员
           <input type="checkbox" name="duixiang2" value="全体学生" />全体学生
            </label>
        </div>
        <div class="a">
            活动内容<input type="text" id="neirong" name="neirong" />
        </div>
        <div class="a">
            活动日程安排<input type="text" id="richenganpai" name="richenganpai" />
        </div>
 
 
        <div class="a">
            <button type="submit" class="b">保   存</button>
             <input type="reset" value="重置" />
        </div>
    </form>
</div>
<script type="text/javascript">
    function check() {
        var zhuti = document.getElementById("zhuti");
        var mudi = document.getElementById("mudi");
        var huodongleixing = document.getElementById("huodongleixing");
        var time = document.getElementById("time");
        var didian = document.getElementById("didian");
        var duixiang = document.getElementById("duixiang");
        var neirong = document.getElementById("neirong");
        var richanganpai = document.getElementById("richanganpai");
 
        if(zhuti.value == '') {
        alert('活动主题为空');
        zhuti.focus();
        return false;
        }else if(zhuti.value.length>20){
            alert('活动主题内容超过字数限制');
            zhuti.focus();
            return false;
        }
         
        if (mudi.value == '') {
            alert('活动目的为空');
            mudi.focus();
            return false;
        }else if(mudi.value.length>50){
            alert('活动目的内容超过字数限制');
            mudi.focus();
            return false;
        }
         
        if (huodongleixing.value == '') {
            alert('活动类型为空');
            huodongleixing.focus();
            return false;
        }
         
        if (didian.value == '') {
            alert('无地点');
            didian.focus();
            return false;
        }
         
        if (duixiang.value == '') {
            alert('无活动对象');
            duixiang.focus();
            return false;
        }
         
        if (neirong.value == '') {
            alert('无活动内容');
            neirong.focus();
            return false;
        }else if(neirong.value.length>500){
            alert('活动内容超过字数限制');
            neirong.focus();
            return false;
        }
         
        if(richanganpai.value == '')
        {
            alert('无日程安排');
            richanganpai.focus();
            return false;
 
        }else if(richanganpai.value.length>500){
            alert('日程安排内容超过字数限制');
            richanganpai.focus();
            return false;
        }
    }
</script>
</body>
</html>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>删除活动信息</title>
 
</head>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
 
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
<h1 style="color: black;">删除活动信息</h1>
<a href="Screen.jsp">返回主页</a>
<form action="Servlet?method=getbyname" method="post" onsubmit="return check()">
<div class="a">
活动主题<input type="text" id="zhuti" name="zhuti"/>
</div>
<div class="a">
<button type="submit" class="b">删  除</button>
</div>
</form>
</div>
<script type="text/javascript">
function check() {
var zhuti = document.getElementById("zhuti");
 
//非空
if(name.value == '') {
alert('户主名为空');
name.focus();
return false;
}
}
</script>
</body>
</html>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>信息删除</title>
    <style>
        .a{
            margin-top: 20px;
        }
        .b{
            font-size: 20px;
            width: 160px;
            color: white;
            background-color: greenyellow;
        }
        .tb, td {
            border: 1px solid black;
            font-size: 22px;
        }
    </style>
</head>
<body>
<div align="center">
    <h1 style="color: black;">信息删除</h1>
    <a href="Screen.jsp">返回主页</a>
    <table class="tb">
        <div class="a">
            <tr>
                <td>活动主题</td>
                <td>${bean.zhuti}</td>
            </tr>
            <tr>
                <td>活动目的</td>
                <td>${bean.mudi}</td>
            </tr>
            <tr>
                <td>活动类型</td>
                <td>${bean.huodongleixing}</td>
            </tr>
            <tr>
                <td>活动时间</td>
                <td>${bean.time}</td>
            </tr>
            <tr>
                <td>活动地点</td>
                <td>${bean.didian}</td>
            </tr>
            <tr>
                <td>活动对象</td>
                <td>${bean.duixiang}</td>
            </tr>
            <tr>
                <td>活动内容</td>
                <td>${bean.neirong}</td>
            </tr>
            <tr>
                <td>活动安排</td>
                <td>${bean.richenganpai}</td>
            </tr>
    </table>
    <div class="a">
        <a onclick="return check()" href="Servlet?method=del&zhuti=${bean.zhuti}">删   除</a>
    </div>
 
</div>
 
<script type="text/javascript">
    function check() {
        if (confirm("真的要删除吗?")){
            return true;
        }else{
            return false;
        }
    }
</script>
</body>
</html>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
 
</head>
<style>
    .a{
        margin-top: 20px;
    }
    .b{
        font-size: 20px;
        width: 160px;
        color: white;
        background-color: greenyellow;
    }
    .tb, td {
        border: 1px solid black;
        font-size: 22px;
    }
</style>
<body>
<%
 
    Object message = request.getAttribute("message");
    if(message!=null && !"".equals(message)){
 
%>
<script type="text/javascript">
    alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
    <h1 style="color: black;">信息列表</h1>
    <a href="Screen.jsp">返回主页</a>
    <table class="tb">
         
        <form action="Servlet?method=update&zhuti=${bean.zhuti}" method="post" onsubmit="return check()">
            <tr><td>活动主题</td>
            <td><input type="text" id="zhuti" name="zhuti" value="${bean.zhuti}" /></td></tr>
            <tr><td>活动目的</td>
            <td><input type="text" id="mudi" name="mudi"value="${bean.zhuti}" /></td></tr>
            <tr><td>活动类型</td>
            <td><input type="text" id="huodongleixing" name="huodongleixing value="${bean.huodongleixing}"" /></td></tr>
            <tr><td>活动时间</td>
            <td><input type="text" id="time" name="time" value="${bean.time}"/></td></tr>
            <tr><td>活动地点</td>
            <td><input type="text" id="didian" name="didian" value="${bean.didian}"/></td></tr>
            <tr><td>活动对象</td>
            <td><input type="text" id="duixiang" name="duixiang" value="${bean.duixiang}"/></td></tr>
            <tr><td>活动内容</td>
            <td><input type="text" id="neirong" name="neirong" value="${bean.neirong}" /></td></tr>
            <tr><td>活动安排</td>
            <td><input type="text" id="richenganpai" name="richenganpai" value="${bean.richenganpai}"/></td></tr>
             
        </form>
    </table>
            <td><button type="submit" class="b">修改</button></td>
</div>
 
</body>
</html>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<%@ page import="Bean.bean" %>
<%@ page import="java.util.List" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>信息列表</title>
 
</head>
<style>
    .a{
        margin-top: 20px;
    }
    .b{
        font-size: 20px;
        width: 160px;
        color: white;
        background-color: greenyellow;
    }
    .tb, td {
        border: 1px solid black;
        font-size: 22px;
    }
</style>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
 
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
    <h1 style="color: black;">信息列表</h1>
    <a href="Screen.jsp">返回主页</a>
    <table class="tb">
        <tr>
        <td>活动主题</td>
        <td>活动目的</td>
        <td>活动类型</td>
        <td>活动时间</td>
        <td>活动地点</td>
        <td>活动对象</td>
        <td>活动内容</td>
        <td>活动日程安排</td>
        </tr>
        <tr>
            <td>${bean.zhuti}</td>
            <td>${bean.mudi}</td>
            <td>${bean.huodongleixing}</td>
            <td>${bean.time}</td>
            <td>${bean.didian}</td>
            <td>${bean.duixiang}</td>
            <td>${bean.neirong}</td>
            <td>${bean.richenganpai}</td>
        </tr>
    </table>
</div>
</body>
</html>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="Bean.bean" %>
<%@ page isELIgnored="false"%>
<html>
<head>
    <title>Title</title>
</head>
<style>
    .a{
        margin-top: 20px;
    }
    .b{
        font-size: 20px;
        width: 160px;
        color: white;
        background-color: greenyellow;
    }
    .tb, td {
        border: 1px solid black;
        font-size: 22px;
    }
</style>
<body>
<div align="center">
    <h1 style="color: black;">信息列表</h1>
    <a href="Screen.jsp">返回主页</a>
    <table class="tb">
        <tr>
            <td>活动主题</td>
            <td>活动目的</td>
            <td>活动类型</td>
            <td>活动时间</td>
            <td>活动地点</td>
            <td>活动对象</td>
            <td>活动内容</td>
            <td>活动日程安排</td>
 
        </tr>
        <%
        ArrayList<bean> list =(ArrayList<bean>)request.getAttribute("list");
            int i=list.size();
 
            for(int k=0;k<i;k++)
            {out.print("<tr>");
                bean p=list.get(k);
                out.println("<td>"+p.getZhuti()+"</td>"+"<td>"+p.getMudi()+"</td>"+"<td>"+p.getHuodongleixing()+"</td>"+
                        "<td>"+p.getTime()+"</td>"+"<td>"+p.getDidian()+"</td>"+"<td>"+p.getDuixiang()+"</td>"+"<td>"+p.getNeirong()+"</td>"+"<td>"+p.getRichenganpai()+"</td>");
                out.print("</tr>");
                out.print("<br>");
        %>
        <p>
 
                <%}
 
        %>
    </table>
 
 
</div>
</body>
</html>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>校园社团活动管理系统</title>
 
</head>
<body>
<div align="center">
<div class="a">
<font size=5>欢迎使用校园社团活动管理系统</font>
</div>
<div class="a">
<a href="add.jsp"><font size=3>发布活动信息</font></a>
</div>
<div class="a">
<a href="update.jsp"><font size=3>修改活动信息</font></a>
</div>
<div class="a">
<a href="del.jsp"><font size=3>删除活动信息</font></a>
</div>
<div class="a">
<a href="search.jsp"><font size=3>活动信息查询</font></a>
</div>
<div class="a">
<a href="Servlet?method=liulan"><font size=3>活动信息浏览</font></a>
</div>
</div>
</body>
</html>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>人口登记信息查询</title>
 
</head>
<body>
<div align="center">
    <h1 style="color: black;">信息查询</h1>
    <a href="Screen.jsp">返回主页</a>
    <form action="Servlet?method=search" method="post" onsubmit="return check()">
        <div class="a">
            活动主题<input type="text" id="zhuti" name="zhuti"/>
        </div>
        <div class="a">
            活动时间<input type="text" id="shijain" name="shijain" />
        </div>
        <div class="a">
            活动类型<input type="text" id="leixing" name="leixing" />
        </div>
        <div class="a">
            活动地点<input type="text" id="didian" name="didian" />
        </div>
        <div class="a">
            <button type="submit" class="b">查   询</button>
        </div>
    </form>
</div>
</body>
</html>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>修改活动信息</title>
</head>
 
<body>
<%
    Object message = request.getAttribute("message");
    if(message!=null && !"".equals(message)){
 
%>
<script type="text/javascript">
    alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<div align="center">
    <h1 style="color: black;">信息修改</h1>
    <a href="Screen.jsp">返回主页</a>
    <form action="Servlet?method=update" method="post" onsubmit="return check()">
        <div class="a">
            活动主题<input type="text" id="zhuti" name="zhuti"/>
        </div>
        <div class="a">
            <button type="submit" class="b">查   找</button>
        </div>
    </form>
</div>
</body>
</html>

  

 

posted @   一统天下。  阅读(396)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· DeepSeek在M芯片Mac上本地化部署
点击右上角即可分享
微信分享提示