1、pox中的配置文件
复制代码
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<dependencies> <!-- josn配置文件--> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.51</version> </dependency> <!--数据库配置文件--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.25</version> </dependency> <!-- servlet配置文件包--> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <!--<!– 数据库连接池模板 –> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.10</version> </dependency> <!– JDBCTemplate模板 –> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>5.2.15.RELEASE</version> </dependency>--> </dependencies>
2、首先定义两个实体类
t_user
复制代码
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
94package servlet; public class t_user { private int id; private String username; private String password; private String email; private String phone; private String avatar; private String role; private String department; private String position; public t_user() { } public t_user(int id, String username, String password, String email, String phone, String avatar, String role, String department, String position) { this.id = id; this.username = username; this.password = password; this.email = email; this.phone = phone; this.avatar = avatar; this.role = role; this.department = department; this.position = position; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getAvatar() { return avatar; } public void setAvatar(String avatar) { this.avatar = avatar; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } public String getDepartment() { return department; } public void setDepartment(String department) { this.department = department; } public String getPosition() { return position; } public void setPosition(String position) { this.position = position; } @Override public String toString() { return "t_user{" + "id=" + id + ", username='" + username + ''' + ", password='" + password + ''' + ", email='" + email + ''' + ", phone='" + phone + ''' + ", avatar='" + avatar + ''' + ", role='" + role + ''' + ", department='" + department + ''' + ", position='" + position + ''' + '}'; } }
t_role
复制代码
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
49package servlet; public class t_role { private int id; //行id private String name;//名称 private String description;//位置 private String permission; public t_role() { } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getPermission() { return permission; } public void setPermission(String permission) { this.permission = permission; } public t_role(int id, String name, String description, String permission) { this.id = id; this.name = name; this.description = description; this.permission = permission; } @Override public String toString() { return "t_role{" + "id=" + id + ", name='" + name + ''' + ", description='" + description + ''' + ", permission='" + permission + ''' + '}'; } }
3、封装两个工具类
DrServlet
复制代码
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
49package utils; 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 java.io.IOException; import java.lang.reflect.Method; public class DrServlet extends HttpServlet { protected String MyUrl="/error.html"; @Override protected void service(HttpServletRequest Request, HttpServletResponse Response) throws ServletException, IOException { String uri= Request.getRequestURI(); String name=uri.substring(uri.lastIndexOf("/")+1); try { //获取当前类的Class对象 Class classType = this.getClass(); //实例化类 Object invokeTester = classType.newInstance(); //获取类中所有对象 Method[] methods = classType.getDeclaredMethods(); boolean b=true; for (Method method : methods) { if(name.equalsIgnoreCase(method.getName())){ b=false; //获取类里面的方法对象,参数:1、方法名,2、参数列表(形参) Method addmethod = classType.getMethod(name, new Class[]{HttpServletRequest.class,HttpServletResponse.class}); //方法实现,通过实例化的类实现方法 Object obj = addmethod.invoke(invokeTester, new Object[]{Request, Response}); if(obj!=null){ //返回路径 String s = obj.toString().toLowerCase(); String substring = s.substring(s.lastIndexOf(":") + 1); if(s.indexOf("redirect")!=-1){ Response.sendRedirect(Request.getContextPath()+substring); }else if(s.indexOf("forward")!=-1){ Request.getRequestDispatcher(substring).forward(Request,Response); } } } } if(b){ Response.sendRedirect(Request.getContextPath()+MyUrl); } } catch (Exception e) { e.printStackTrace(); } } }
Jdbcutils 工具类
复制代码
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
43package utils; import java.sql.*; public class JDBCUtils { private static String driver = "com.mysql.cj.jdbc.Driver"; private static String url = "jdbc:mysql://localhost:3306/meirong?serverTimezone=UTC"; private static String username = "root"; private static String password = "123456"; static{ try{ Class.forName(driver); }catch (Exception e) { throw new ExceptionInInitializerError(e); } } public static Connection getConnection() throws SQLException { return DriverManager.getConnection(url, username,password); } public static void release(Connection conn, Statement st, ResultSet rs) { if (rs != null) { try { rs.close(); } catch (Exception e) { e.printStackTrace(); } rs = null; } if (st != null) { try { st.close(); } catch (Exception e) { e.printStackTrace(); } } if (conn != null) { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } } } }
user增删改查
复制代码
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
43package utils; import java.sql.*; public class JDBCUtils { private static String driver = "com.mysql.cj.jdbc.Driver"; private static String url = "jdbc:mysql://localhost:3306/meirong?serverTimezone=UTC"; private static String username = "root"; private static String password = "123456"; static{ try{ Class.forName(driver); }catch (Exception e) { throw new ExceptionInInitializerError(e); } } public static Connection getConnection() throws SQLException { return DriverManager.getConnection(url, username,password); } public static void release(Connection conn, Statement st, ResultSet rs) { if (rs != null) { try { rs.close(); } catch (Exception e) { e.printStackTrace(); } rs = null; } if (st != null) { try { st.close(); } catch (Exception e) { e.printStackTrace(); } } if (conn != null) { try { conn.close(); } catch (Exception 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
43package utils; import java.sql.*; public class JDBCUtils { private static String driver = "com.mysql.cj.jdbc.Driver"; private static String url = "jdbc:mysql://localhost:3306/meirong?serverTimezone=UTC"; private static String username = "root"; private static String password = "123456"; static{ try{ Class.forName(driver); }catch (Exception e) { throw new ExceptionInInitializerError(e); } } public static Connection getConnection() throws SQLException { return DriverManager.getConnection(url, username,password); } public static void release(Connection conn, Statement st, ResultSet rs) { if (rs != null) { try { rs.close(); } catch (Exception e) { e.printStackTrace(); } rs = null; } if (st != null) { try { st.close(); } catch (Exception e) { e.printStackTrace(); } } if (conn != null) { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } } } }
jsp前端页面
user表
复制代码
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Layui</title> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css"> <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <!-- 注意:如果你直接复制所有代码到本地,上述css路径需要改成你本地的 --> </head> <body> <div class="site-text" style="margin: 5%; display: none" id="window" target="test123"> <form class="layui-form" id="book" method="post" lay-filter="example"> <!-- <div class="layui-form-item"> <label class="layui-form-label">编号</label> <div class="layui-input-block"> <input type="text" id="id" name="id" lay-verify="title" autocomplete="off" placeholder="请输入编号" class="layui-input"> </div> </div>--> <div class="layui-form-item"> <label class="layui-form-label">用户名</label> <div class="layui-input-block"> <input type="text" id="username" name="username1" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">密码</label> <div class="layui-input-block"> <input type="text" id="password" name="password" lay-verify="title" autocomplete="off" placeholder="请输入密码" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">邮箱</label> <div class="layui-input-block"> <input type="text" id="email" name="email" lay-verify="title" autocomplete="off" placeholder="请输入邮箱" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">手机号</label> <div class="layui-input-block"> <input type="text" id="phone" name="phone" lay-verify="title" autocomplete="off" placeholder="请输入手机号" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">头像</label> <div class="layui-input-block"> <input type="text" id="avatar" name="avatar" lay-verify="title" autocomplete="off" placeholder="请输入头像" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">权限</label> <div class="layui-input-block"> <input type="text" id="role" name="role" lay-verify="title" autocomplete="off" placeholder="请输入权限" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">部门</label> <div class="layui-input-block"> <input type="text" id="department" name="department" lay-verify="title" autocomplete="off" placeholder="请输入部门" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">职位</label> <div class="layui-input-block"> <input type="text" id="position" name="position" lay-verify="title" autocomplete="off" placeholder="请输入职位" class="layui-input"> </div> </div> <!--<div class="layui-form-item"> <div class="layui-input-block"> <button class="layui-btn" lay-submit lay-filter="demo1">确认</button> </div> </div>--> </form> </div> <div class="demoTable"> 搜索用户名: <div class="layui-inline"> <input class="layui-input" name="name" id="demoReload" autocomplete="off"> </div> <button class="layui-btn" data-type="reload" id="bbttnn">搜索</button> </div> <table class="layui-table" lay-data="{width: 1200, height:330, url:'/Servlet_war/user/list', page:false, id:'idTest'}" lay-filter="demo"> <thead> <tr> <th lay-data="{type:'checkbox', fixed: 'left'}"></th> <th lay-data="{field:'id', width:80, sort: true}"> 编号</th> <th lay-data="{field:'username', width:80}"> 用户名</th> <th lay-data="{field:'password', width:80, sort: true}"> 密码</th> <th lay-data="{field:'email', width:80}"> 邮箱</th> <th lay-data="{field:'phone', width:160}"> 手机号</th> <th lay-data="{field:'avatar', width:80, sort: true}"> 头像</th> <th lay-data="{field:'role', width:80}"> 权限</th> <th lay-data="{field:'department', width:135, sort: true}"> 部门</th> <th lay-data="{field:'position', width:80, sort: true}"> 职位</th> <th lay-data="{fixed: 'right', width:178, align:'center', toolbar: '#barDemo'}"></th> </tr> </thead> </table> <!--<button id="inst" class="layui-btn">添加</button>--> <script type="text/html" id="barDemo"> <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="insert" id="inst">添加</a> </script> <script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script> <script src="js/jquery.js" charset="utf-8"></script> <!-- 注意:如果你直接复制所有代码到本地,上述 JS 路径需要改成你本地的 --> <script> layui.use(['table','form'], function () { var upOrIns; var table = layui.table; var form = layui.form; //监听工具条 table.on('tool(demo)', function (obj) { var data = obj.data; if (obj.event === 'del') { layer.open({ btn: ['确认', '取消'], content: '真的删除行么', skin: 'layui-layer-molv', yes: function (index) { obj.del(); layer.close(index); $.post("/Servlet_war/user/del", {"id": data.id}); }, no: function () { layer.close(index); } }); } else if (obj.event === 'edit') { layer.open({ btn:["确认","取消"] , type: 1 , title: ['修改信息'] , shadeClose: true , shade: 0 , maxmin: true , content: $("#window") , success: function (layer, index) { $('#username').val(data.username); $('#password').val(data.password); $('#email').val(data.email); $('#phone').val(data.phone); $('#avatar').val(data.avatar); $('#role').val(data.role); $('#department').val(data.department); $('#position').val(data.position); }, end: function () { $("input[type=text]").val("") $("#window").hide(); },yes:function (index) { $.post("/Servlet_war/user/update", { "id":data.id, "username":$('#username').val(), "password":$("#password").val(), "email":$("#email").val(), "phone":$("#phone").val(), "avatar":$("#avatar").val(), "role":$("#role").val(), "department":$("#department").val(), "position":$("#position").val() },function () { window.location.reload(); }); layer.close(index); } }); } else if (obj.event === 'insert') { layer.open({ btn:["确认","取消"] , type: 1 , title: ['添加信息'] , shadeClose: true , shade: 0 , maxmin: true , content: $("#window") , success: function (layer, index) { /*$('#username').val(data.username); $('#password').val(data.password); $('#email').val(data.email); $('#phone').val(data.phone); $('#avatar').val(data.avatar); $('#role').val(data.role); $('#department').val(data.department); $('#position').val(data.position);*/ }, end: function () { $("input[type=text]").val("") $("#window").hide(); },yes:function (index) { $.post("/Servlet_war/user/add", { "username":$('#username').val(), "password":$("#password").val(), "email":$("#email").val(), "phone":$("#phone").val(), "avatar":$("#avatar").val(), "role":$("#role").val(), "department":$("#department").val(), "position":$("#position").val() },function () { window.location.reload(); }); layer.close(index); } }); } }); /* $("#inst").click(function(){ layer.open({ btn:["确认","取消"] , type: 1 , title: ['添加信息'] , shadeClose: true , shade: 0 , maxmin: true , content: $("#window") , success: function (layer, index) { }, end: function () { $("#window").hide(); },yes:function (index) { $.post("/test/user/add",{ "username":$('#username').val(), "password":$("#password").val(), "email":$("#email").val(), "phone":$("#phone").val(), "avatar":$("#avatar").val(), "role":$("#role").val(), "department":$("#department").val(), "position":$("#position").val() },function () { window.location.reload(); }); layer.close(index); } }); });*/ $("#bbttnn").click(function () { table.reload('idTest', {url: '/Servlet_war/user/name?name='+$("#demoReload").val() , where: {}},false) }); /*$("#bbttnn").click(function () { table.reload('demo', {url: '/Servlet_war/user/name?name='+$("#find").val() , where: {}},false) });*/ }); </script> </body> </html>
role表
复制代码
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<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <!DOCTYPE html> <html> <head> <title>JSP - Hello World</title> <!-- 引入 layui.css --> <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css"> <!-- 引入 layui.js --> <script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script> <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> </head> <body> <div class="demoTable"> 搜索ID: <div class="layui-inline"> <input class="layui-input" name="name2" id="demoReload" autocomplete="off"> </div> <button class="layui-btn" data-type="reload" id="bbttnn">搜索</button> </div> <%--这是编辑的页面--%> <div class="site-text" style="margin: 5%; display: none" id="window" target="test123"> <form class="layui-form" id="book" method="post" lay-filter="example"> <div class="layui-form-item"> <label class="layui-form-label">id</label> <div class="layui-input-block"> <input type="text" id="id" name="id" lay-verify="title" autocomplete="off" readonly="value" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">名称</label> <div class="layui-input-block"> <input type="text" id="id1" name="name" lay-verify="title" autocomplete="off" placeholder="请输入名称" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">描述</label> <div class="layui-input-block"> <input type="text" id="id2" name="description" lay-verify="title" autocomplete="off" placeholder="请输入描述" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">权限列表</label> <div class="layui-input-block"> <input type="text" id="id3" name="permission" lay-verify="title" autocomplete="off" placeholder="请输入权限列表" class="layui-input"> </div> </div> </form> </div> <%--这是添加的页面--%> <div class="site-text" style="margin: 5%; display: none" id="w1" target="test123"> <form class="layui-form" id="book_2" method="post" lay-filter="example"> <div class="layui-form-item"> <label class="layui-form-label">名称</label> <div class="layui-input-block"> <input type="text" id="id11" name="name1" lay-verify="title" autocomplete="off" placeholder="请输名称" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">描述</label> <div class="layui-input-block"> <input type="text" id="id12" name="description1" lay-verify="title" autocomplete="off" placeholder="请输入描述" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">权限列表</label> <div class="layui-input-block"> <input type="text" id="id13" name="permission1" lay-verify="title" autocomplete="off" placeholder="请输入权限列表" class="layui-input"> </div> </div> </form> </div> <table class="layui-table" lay-data="{width: 1000, height:600, url:'/Servlet_war/role/list', page:true, id:'idTest'}" lay-filter="demo"> <thead> <tr> <th lay-data="{type:'checkbox', fixed: 'left'}"></th> <th lay-data="{field:'id', width:80, sort: true, fixed: true}">ID</th> <th lay-data="{field:'name', width:150}">名称</th> <th lay-data="{field:'description', width:150, sort: true}">描述</th> <th lay-data="{field:'permission', width:300}">权限列表</th> <th lay-data="{fixed: 'right', width:200, align:'center', toolbar: '#barDemo'}"></th> </tr> </thead> </table> <script type="text/html" id="barDemo"> <a class="layui-btn layui-btn layui-btn-sm" lay-event="edit">编辑</a> <a class="layui-btn layui-btn-danger layui-btn layui-btn-sm" lay-event="del">删除</a> <a class="layui-btn layui-btn-normal layui-btn layui-btn-sm" lay-event="detail">添加</a> </script> <script> layui.use(['table','jquery'], function(){ var table = layui.table; //监听表格复选框选择 table.on('checkbox(demo)', function(obj){ console.log(obj) }); //监听工具条 table.on('tool(demo)', function(obj){ var data = obj.data; if(obj.event === 'edit'){ layer.open({ type: 1 //Page层类型 ,skin: 'layui-layer-molv' ,area: ['380px', '400px'] ,title: ['编辑信息','font-size:18px'] ,btn: ['确定', '取消'] ,shadeClose: true ,shade: 0 //遮罩透明度 ,maxmin: true //允许全屏最小化 ,content:$("#window") //弹窗路径 ,success:function(layero,index){ $('#id').val(data.id); $('#id1').val(data.name); $('#id2').val(data.description); $('#id3').val(data.permission); },yes:function(index,layero){ $("#window").hide(); $.post("/Servlet_war/role/update", {"id":data.id,"name":$("#id1").val(),"description":$("#id2").val(),"permission":$("#id3").val()},function (){ window.location.reload(); }); layer.close(index); },no:function(index,layero){ $("#window").hide(); $("#window").css( "display:none"); layer.close(index); },end:function (){ $("#window").hide(); } }); } else if(obj.event === 'del'){ layer.confirm('真的删除行么', function(index){ obj.del(); layer.close(index); $.post("/Servlet_war/role/del",{"id":data.id}); }); } else if(obj.event === 'detail'){ layer.open({ type: 1 //Page层类型 ,skin: 'layui-layer-molv' ,area: ['380px', '400px'] ,title: ['添加信息','font-size:18px'] ,btn: ['确定', '取消'] ,shadeClose: true ,shade: 0 //遮罩透明度 ,maxmin: true //允许全屏最小化 ,content:$("#w1") //弹窗路径 ,success:function(layero,index){ },yes:function(index,layero){ $("#w1").hide(); $.post("/Servlet_war/role/add",{"name1":$("#id11").val(),"description1":$("#id12").val(),"permission1":$("#id13").val()},function (){ window.location.reload(); }); layer.close(index); },no:function(index,layero){ $("#w1").hide(); $("#w1").css( "display:none"); layer.close(index); },end:function (){ $("#w1").hide(); } }); } }); $("#bbttnn").click(function () { table.reload('idTest', {url: '/Servlet_war/role/list?name2='+$("#demoReload").val() ,where: {}},false) }); }); </script> </body> </html>
最后
以上就是眼睛大电脑最近收集整理的关于layui 中servlet增删改查1、pox中的配置文件2、首先定义两个实体类3、封装两个工具类 jsp前端页面的全部内容,更多相关layui内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复