基于javaweb+jsp的学生考勤管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

这是一个基于JavaWeb、JSP、Servlet、SpringBoot和Bootstrap的学生考勤管理系统,包括用户认证、数据持久化、页面交互等功能。系统使用了MVC模式,支持MySQL数据库,可以用于课程设计、大作业、毕业设计等项目练习。关键功能涉及登录验证、用户信息管理、考勤记录的增删改查。

基于javaweb+jsp的学生考勤管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

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

import java.util.Random;

@Controller
public class AuthController extends HttpServlet {
    @Autowired
    private UserService userService;

    @RequestMapping("authLogin")
    public void login(HttpServletResponse response, HttpServletRequest request) throws IOException, ServletException {
        String username = Util.decode(request, "username");
        String password = Util.decode(request, "password");

        String validationCode = Util.decode(request, "validationCode");
        if (validationCode != null && !validationCode.equals(request.getSession().getAttribute("validationCode"))) {//验证码不通过
            request.getSession().setAttribute("alert_msg", "错误:验证码不正确!");
            request.getRequestDispatcher("login.jsp").forward(request, response);
            return;
        }

        Map<String, Object> params = new HashMap();
                    <if test ='userType != null'>`user_type`</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>#{id},</if>
                    <if test ='username != null'>#{username},</if>
                    <if test ='password != null'>#{password},</if>
                    <if test ='realName != null'>#{realName},</if>
                    <if test ='userSex != null'>#{userSex},</if>
                    <if test ='userPhone != null'>#{userPhone},</if>
                    <if test ='userText != null'>#{userText},</if>
                    <if test ='userType != null'>#{userType}</if>
        </trim>
    </insert>
    </sql>

    <!--新增-->
    <insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.Student">
        INSERT INTO `t_student`
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>`id`,</if>
                    <if test ='studentNo != null'>`student_no`,</if>
                    <if test ='studentName != null'>`student_name`,</if>
                    <if test ='studentSex != null'>`student_sex`,</if>
                    <if test ='studentClass != null'>`student_class`,</if>
                    <if test ='studentPhone != null'>`student_phone`,</if>
                    <if test ='studentEmail != null'>`student_email`,</if>
                    <if test ='studentText != null'>`student_text`</if>
        </trim>
        this.studentClass = studentClass;
    }
    public String getStudentPhone() {
        return studentPhone;
    }

    public void setStudentPhone(String studentPhone) {
        this.studentPhone = studentPhone;
    }
    public String getStudentEmail() {
        return studentEmail;
    }

    public void setStudentEmail(String studentEmail) {
        this.studentEmail = studentEmail;
    }
    public String getStudentText() {
                <if test ='realName != null'>`real_name` = #{realName},</if>
                <if test ='userSex != null'>`user_sex` = #{userSex},</if>
                <if test ='userPhone != null'>`user_phone` = #{userPhone},</if>
                <if test ='userText != null'>`user_text` = #{userText},</if>
                <if test ='userType != null'>`user_type` = #{userType}</if>
        </set>
        WHERE `id` = #{id}
    </update>

    <!--获取-->
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_user` WHERE `id` = #{id}
    </select>

    <!--列表-->
    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_user`
        <where>
            <div class="col-sm-5">
                <input name="recordStatus" type="radio" value="正常" checked="checked"/>&nbsp;&nbsp;&nbsp;正常&nbsp;&nbsp;&nbsp;&nbsp;
                <input name="recordStatus" type="radio" value="迟到"/>&nbsp;&nbsp;&nbsp;迟到&nbsp;&nbsp;&nbsp;&nbsp;
                <input name="recordStatus" type="radio" value="早退"/>&nbsp;&nbsp;&nbsp;早退&nbsp;&nbsp;&nbsp;&nbsp;
                <input name="recordStatus" type="radio" value="请假"/>&nbsp;&nbsp;&nbsp;请假&nbsp;&nbsp;&nbsp;&nbsp;
                <input name="recordStatus" type="radio" value="旷课"/>&nbsp;&nbsp;&nbsp;旷课&nbsp;&nbsp;&nbsp;&nbsp;
                <input name="recordStatus" type="radio" value="其它"/>&nbsp;&nbsp;&nbsp;其它&nbsp;&nbsp;&nbsp;&nbsp;
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">时间:</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" id="recordTime" name="recordTime">
            </div>
        </div>
        <div class="form-group">
            <div class="form-group">
                <label class="col-sm-3 control-label">邮箱:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="studentEmail" name="studentEmail" value="${vo.studentEmail}">
                </div>
            </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注:</label>
            <div class="col-sm-5">
                <textarea rows="3" class="form-control" id="studentText" name="studentText" placeholder="请输入内容......">${vo.studentText}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"></label>
            <div class="col-sm-5">
                <input type="submit" class="btn btn-pill btn-warning btn-sm" value="保存">
                <input type="button" class="btn btn-pill btn-info btn-sm" value="返回" onclick="javascript:history.back(-1);">
            </div>
        </div>
    </form>
</div>
</body>
<script type="text/javascript">
                    <if test ='recordCourse != null'>`record_course`,</if>
                    <if test ='recordClass != null'>`record_class`,</if>
                    <if test ='recordStatus != null'>`record_status`,</if>
                    <if test ='recordTime != null'>`record_time`,</if>
                    <if test ='recordText != null'>`record_text`</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>#{id},</if>
                    <if test ='recordName != null'>#{recordName},</if>
                    <if test ='recordNo != null'>#{recordNo},</if>
                    <if test ='recordCourse != null'>#{recordCourse},</if>
                    <if test ='recordClass != null'>#{recordClass},</if>
                    <if test ='recordStatus != null'>#{recordStatus},</if>
                    <if test ='recordTime != null'>#{recordTime},</if>
                    <if test ='recordText != null'>#{recordText}</if>
        </trim>
    </insert>

    <!--批量删除-->
    <delete id="doRemoveBatch" parameterType="java.util.Collection">
        DELETE FROM `t_record` WHERE `id` IN
        <foreach collection="list" item="id" separator="," open="(" close=")">
     * @throws IOException
     */
    @RequestMapping("userList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
package com.demo.controller;

import com.demo.util.Util;
import com.demo.service.CourseService;
import com.demo.vo.Course;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping
public class CourseController {

    @Autowired
    private CourseService courseService;


    <!--新增-->
    <insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.User">
        INSERT INTO `t_user`
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>`id`,</if>
                    <if test ='username != null'>`username`,</if>
                    <if test ='password != null'>`password`,</if>
                    <if test ='realName != null'>`real_name`,</if>
                    <if test ='userSex != null'>`user_sex`,</if>
                    <if test ='userPhone != null'>`user_phone`,</if>
                    <if test ='userText != null'>`user_text`,</if>
                    <if test ='userType != null'>`user_type`</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>#{id},</if>
                    <if test ='username != null'>#{username},</if>
                    <if test ='password != null'>#{password},</if>
                    <if test ='realName != null'>#{realName},</if>
                    <if test ='userSex != null'>#{userSex},</if>
                    <if test ='userPhone != null'>#{userPhone},</if>
                    <if test ='userText != null'>#{userText},</if>
                    <if test ='userType != null'>#{userType}</if>
        </trim>
    </insert>


运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

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

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

适用

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

功能说明

登录、注册、退出、用户模块、公告模块、课程模块、考勤模块、学生模块的增删改查管理

20220319000145

20220319000146

20220319000147

20220319000148

20220319000149

20220319000150

20220319000151

20220319000152

20220319000153

20220319000154

20220319000155

20220319000156

document

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值