studentloginsvlt.java

来自「一个管理系统」· Java 代码 · 共 62 行

JAVA
62
字号
package stuman;

import java.io.*;
import java.sql.ResultSet;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class StudentLoginSvlt extends HttpServlet {

    public void doGet(HttpServletRequest req, HttpServletResponse res)
            throws ServletException, IOException {

        String stu_id = req.getParameter("id");
        String cour_id = req.getParameter("cour_id");
        String class_id = req.getParameter("class_id");
        String prepare = req.getParameter("prepare");
        String pw1 = null;
        String pw2 = null;
        String e_mail = null;
        String tel = null;
        String action = req.getParameter("action");

        ResultSet rs = null;

        if ("update".equalsIgnoreCase(action)) {

            stu_id = req.getParameter("id");
            pw1 = req.getParameter("password1");
            pw2 = req.getParameter("password2");
            if (pw1.equals("") || pw2.equals("") || pw1 == null || pw2 == null) {
                doError(req, res, "锟斤拷锟诫不锟斤拷为锟秸o拷");
            }
            e_mail = req.getParameter("e_mail");
            tel = req.getParameter("tel");
            doUpdate(req, res, pw1, pw2, e_mail, tel, stu_id);
            res.sendRedirect("/test/student.jsp");
        }


        if ("checkmark".equalsIgnoreCase(action)) {
            rs = getScore(stu_id);
            sendResultSet(req, res, rs, "/checkmark.jsp");
        }

        if ("enrol".equalsIgnoreCase(action)) {

            doEnrol(req,res,stu_id,cour_id,class_id,prepare);	
            res.sendRedirect("/test/DisplayCourse.jsp");
        }

    }

    public void doEnrol(HttpServletRequest req, HttpServletResponse res,
            String stu_id, String cour_id, String class_id, String prepare)
            throws ServletException, IOException {

        int num = 0;
        checkEnrol check = new checkEnrol();

        if (prepare.equals("0")) {
           // doError(req, res, "注锟斤拷纬锟绞э拷埽锟斤拷锟

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?