一、需求分析
- E-R图、需求分析
- 登录分为管理员登录和一般用户登录,不同用户根据不同的账号密码进入不同的页面
- 要有登录和退出功能
- 学生选:课和查课,修改密码,信息
- 老师:查看学生成绩,录入成绩,查看学生信息,修改密码
- 管理员:修改学生/老师信息,添加课程,初始化密码等
二、作品展示
- 登录页面
- 用户页面
- 数据库
- 项目列表
三、技术支持
- MySQL
- java
- html+css
- ajax
- jsp
- servlet
- http
- cookie和session
四、部分代码展示
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@WebServlet(name = "AddCourseServlet", value = "/AddCourseServlet")
public class AddCourseServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// response.setContentType("text/html;charset=UTF-8");
BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream(),"utf-8"));
String string = reader.readLine();
JSONObject jsonObject = JSONObject.parseObject(string);
String courseId = jsonObject.getString("courseId");
String courseName = jsonObject.getString("courseName");
String courseTeacher = jsonObject.getString("courseTeacher");
int courseGrade = Integer.parseInt(jsonObject.getString("courseGrade"));
int maxStudent = jsonObject.getByte("maxStudent");
System.out.println(courseId);
System.out.println(courseName);
System.out.println(courseTeacher);
System.out.println(courseGrade);
System.out.println(maxStudent);
AddCourse.add(courseId,courseName,courseTeacher,courseGrade,maxStudent);
}
}