diff --git a/src/servlet/Submit/S_StudentFillTopicInformation.java b/src/servlet/S_StudentFillTopicInformation.java similarity index 96% rename from src/servlet/Submit/S_StudentFillTopicInformation.java rename to src/servlet/S_StudentFillTopicInformation.java index a71f113..9de7b1e 100644 --- a/src/servlet/Submit/S_StudentFillTopicInformation.java +++ b/src/servlet/S_StudentFillTopicInformation.java @@ -1,4 +1,4 @@ -package servlet.Submit; +package servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; diff --git a/src/servlet/Select/S_StudentSelectTeacher.java b/src/servlet/S_StudentSelectTeacher.java similarity index 74% rename from src/servlet/Select/S_StudentSelectTeacher.java rename to src/servlet/S_StudentSelectTeacher.java index 11ba9f3..bc76e6c 100644 --- a/src/servlet/Select/S_StudentSelectTeacher.java +++ b/src/servlet/S_StudentSelectTeacher.java @@ -1,4 +1,4 @@ -package servlet.Select; +package servlet; import core.process.C_StudentSearchTeacher; import core.process.C_StudentSelectTeacher; @@ -9,7 +9,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -@WebServlet("/studentselectteacher") +@WebServlet("/student-select-teacher") public class S_StudentSelectTeacher extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { super.doPost(request, response); @@ -17,11 +17,13 @@ public class S_StudentSelectTeacher extends HttpServlet { User user=(User)request.getSession().getAttribute("user"); String student_id=user.getId(); try { - C_StudentSelectTeacher test=new C_StudentSelectTeacher(); - test.setTeacherId(teacher_id); - test.setStudentId(student_id); + C_StudentSelectTeacher SST=new C_StudentSelectTeacher(); + SST.setTeacherId(teacher_id); + SST.setStudentId(student_id); + SST.select(); } catch (Exception e) { e.printStackTrace(); + response.sendRedirect("/op_fail.jsp"); } } } diff --git a/src/servlet/Submit/S_StudentUploadOpeningReport.java b/src/servlet/S_StudentUploadOpeningReport.java similarity index 95% rename from src/servlet/Submit/S_StudentUploadOpeningReport.java rename to src/servlet/S_StudentUploadOpeningReport.java index 78afd75..df0f052 100644 --- a/src/servlet/Submit/S_StudentUploadOpeningReport.java +++ b/src/servlet/S_StudentUploadOpeningReport.java @@ -1,4 +1,4 @@ -package servlet.Submit; +package servlet; import core.user.User; @@ -12,7 +12,7 @@ import javax.servlet.http.Part; import java.io.IOException; import java.util.UUID; -@WebServlet("/upload") +@WebServlet("/student-upload-opening-report") @MultipartConfig //学生id+文件 public class S_StudentUploadOpeningReport extends HttpServlet { diff --git a/src/servlet/Select/S_TeacherSelectStudent.java b/src/servlet/S_TeacherSelectStudent.java similarity index 73% rename from src/servlet/Select/S_TeacherSelectStudent.java rename to src/servlet/S_TeacherSelectStudent.java index 0bd9ad4..fe20103 100644 --- a/src/servlet/Select/S_TeacherSelectStudent.java +++ b/src/servlet/S_TeacherSelectStudent.java @@ -1,4 +1,4 @@ -package servlet.Select; +package servlet; import core.process.C_TeacherSelectStudent; import core.user.User; @@ -9,7 +9,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -@WebServlet("/teacherselectstudent") +@WebServlet("/teacher-select-student") public class S_TeacherSelectStudent extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { super.doPost(request, response); @@ -17,11 +17,13 @@ public class S_TeacherSelectStudent extends HttpServlet { User user=(User)request.getSession().getAttribute("user"); String teacher_id=user.getId(); try { - C_TeacherSelectStudent test=new C_TeacherSelectStudent(); - test.setTeacherId(teacher_id); - test.setStudentId(student_id); + C_TeacherSelectStudent TSS=new C_TeacherSelectStudent(); + TSS.setTeacherId(teacher_id); + TSS.setStudentId(student_id); + TSS.select(); } catch (Exception e) { e.printStackTrace(); + response.sendRedirect("/op_fail.jsp"); } } } diff --git a/src/servlet/Submit/S_ScoreSubmit.java b/src/servlet/Submit/S_ScoreSubmit.java deleted file mode 100644 index 8e8a11c..0000000 --- a/src/servlet/Submit/S_ScoreSubmit.java +++ /dev/null @@ -1,15 +0,0 @@ -package servlet.Submit; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class S_ScoreSubmit extends HttpServlet { - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - super.doPost(request, response); - String score = request.getParameter("score"); - - } -} diff --git a/src/servlet/Submit/S_TextSubmit.java b/src/servlet/Submit/S_TextSubmit.java deleted file mode 100644 index f799e8a..0000000 --- a/src/servlet/Submit/S_TextSubmit.java +++ /dev/null @@ -1,23 +0,0 @@ -package servlet.Submit; - - -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; -@WebServlet("/textsubmit") -public class S_TextSubmit extends HttpServlet { - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - super.doPost(request, response); - String content=new String(request.getParameter("text").getBytes("ISO8859-1"),"UTF-8"); - String score=request.getParameter("score"); - try { - - - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/src/servlet/account/S_Login.java b/src/servlet/account/S_Login.java index c394db1..f7b9506 100644 --- a/src/servlet/account/S_Login.java +++ b/src/servlet/account/S_Login.java @@ -18,10 +18,10 @@ import error.GExcptSQL; @WebServlet("/login") public class S_Login extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { + throws IOException { String id=request.getParameter("id"); String password=request.getParameter("password"); - User user = null; + User user; try { user = AccountManagement.login(id,password); } catch (GExcptSQL | SQLException gExcptSQL) {