基于javaweb的JSP+Servlet高校教学评价管理系统(java+jsp+javascript+servlet+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

200023432402

210023432402

220023432402

230023432402

240023432402

250023432402

270023432402

280023432402

基于javaweb的JSP+Servlet高校教学评价管理系统(java+jsp+javascript+servlet+mysql)

项目介绍

本项目为后台管理系统,分为管理员与学生两种角色;

管理员角色包含以下功能:

管理员登录,管理员管理,修改密码,教师管理,学生管理,评价指标管理,评价结果查看等功能。

学生角色包含以下功能: 学生角色登录,个人信息修改,评价某一个老师等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;  5.数据库:MySql 5.7版本; 6.是否Maven项目:否;

技术栈

JSP+CSS+JavaScript+servlet+mysql

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中dao/DB.java配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入http://localhost:8080/pingjia 登录 管理员账号/密码:admin/admin 用户账号/密码: liuguangliang/000000

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
        }
return result;
}

public String adminPwEdit(String userPwNew) {
System.out.println("DDDD");
try {
Thread.sleep(700);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
WebContext ctx = WebContextFactory.get();
HttpSession session = ctx.getSession();
TAdmin admin = (TAdmin) session.getAttribute("admin");

String sql = "update t_admin set userPw=? where userId=?";
Object[] params = {userPwNew, admin.getUserId()};
DB mydb = new DB();
mydb.doPstm(sql, params);

return "yes";
}

}
package com.action;




public class zhibiao_servlet extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
String type=req.getParameter("type");
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
			
e.printStackTrace();
}
}
public void init(ServletConfig config) throws ServletException
{
super.init(config);
}

public void destroy()
{

}
}
package com.action;




public class admin_servlet extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
String type=req.getParameter("type");

if(type.endsWith("adminMana"))
{
adminMana(req, res);
}
if(type.endsWith("adminAdd"))
{
adminAdd(req, res);
}
if(type.endsWith("adminDel"))
{
adminDel(req, res);
}
}
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



public class admin_servlet extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
String type=req.getParameter("type");

if(type.endsWith("adminMana"))
{
adminMana(req, res);
}
if(type.endsWith("adminAdd"))
{
adminAdd(req, res);
}
if(type.endsWith("adminDel"))
{
adminDel(req, res);
}
}

public void adminMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
List adminList=new ArrayList();
String sql="select * from t_admin";
Object[] params={};
DB mydb=new DB();
try
{
mydb.doPstm(sql, params);
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
	public void destroy() 
{

}
}
package com.action;




public class tea_servlet extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
String type=req.getParameter("type");

if(type.endsWith("teaMana"))
{
teaMana(req, res);
}
if(type.endsWith("teaAdd"))
{
teaAdd(req, res);
}
if(type.endsWith("teaDel"))
{
teaDel(req, res);
}

if(type.endsWith("teaAll"))
{
teaAll(req, res);
}
}


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
	catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();

req.setAttribute("stuList", stuList);
req.getRequestDispatcher("admin/stu/stuMana.jsp").forward(req, res);
}


public void stuEdit_stu(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
String xuehao=req.getParameter("xuehao");
String name1=req.getParameter("name1");
String sex=req.getParameter("sex");
int age=Integer.parseInt(req.getParameter("age"));
String loginname=req.getParameter("loginname");
String loginpw=req.getParameter("loginpw");

String sql="update t_stu set xuehao=?,name1=?,sex=?,age=?,loginname=?,loginpw=? where id="+Integer.parseInt(req.getParameter("id"));
Object[] params={xuehao,name1,sex,age,loginname,loginpw};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();

req.setAttribute("msg", "修改成功。重新登录后生效");
String targetURL = "/common/msg.jsp";
dispatch(targetURL, req, res);
}

public void dispatch(String targetURI,HttpServletRequest request,HttpServletResponse response)
{
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
try
{
dispatch.forward(request, response);
return;
}
catch (ServletException e)
{
e.printStackTrace();
}
catch (IOException e)
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
        DB mydb = new DB();
mydb.doPstm(sql, params);
try {
ResultSet rs = mydb.getRs();
boolean mark = (rs == null || !rs.next() ? false : true);
if (mark == false) {
result = "no";
} else {
result = "yes";

Tstu stu = new Tstu();
stu.setId(rs.getInt("id"));
stu.setXuehao(rs.getString("xuehao"));
stu.setName1(rs.getString("name1"));
stu.setSex(rs.getString("sex"));
stu.setAge(rs.getInt("age"));
stu.setLoginname(rs.getString("loginname"));
stu.setLoginpw(rs.getString("loginpw"));

System.out.println(stu.getAge() + "%%%");

session.setAttribute("userType", 2);
session.setAttribute("stu", stu);
loginService.currentStudentId = stu.getId();
}
rs.close();
} catch (SQLException e) {
System.out.println("登录失败!");
e.printStackTrace();
} finally {
mydb.closed();
}

}
return result;
}

public String adminPwEdit(String userPwNew) {
System.out.println("DDDD");
try {
Thread.sleep(700);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
WebContext ctx = WebContextFactory.get();
HttpSession session = ctx.getSession();
TAdmin admin = (TAdmin) session.getAttribute("admin");


项目链接:
https://javayms.github.io?id=291122542008200sq
https://javayms.pages.dev?id=291122542008200sq