基于javaweb+jsp的教务管理系统

基于javaweb+jsp的教务管理系统,第1张

基于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等均可配置运行

适用

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

            alert("姓名不能为空!");
            return false;
        }
        if (document.getElementById("teacherDegree").value.trim().length == 0) {
            alert("学历不能为空!");
            return false;
        }
        if (document.getElementById("teacherPotition").value.trim().length == 0) {
            alert("职位不能为空!");
            return false;
        }
        if (document.getElementById("teacherCollege").value.trim().length == 0) {
            alert("院系不能为空!");
            return false;
        }
        if (document.getElementById("teacherPhone").value.trim().length == 0) {
            alert("联系电话不能为空!");
            return false;
        }
        return true;
    }
script>
html>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>

    /**
     * 增加公告
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("noticeAdd")
    public void add(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Notice vo = new Notice();
        //取出页面传进来的参数
        vo.setNoticeName(Util.decode(request, "noticeName"));
        vo.setNoticeText(Util.decode(request, "noticeText"));
            alert("开课地址不能为空!");
            return false;
        }
        if (document.getElementById("courseWeek").value.trim().length == 0) {
            alert("学时不能为空!");
            return false;
        }
        if (document.getElementById("courseCollege").value.trim().length == 0) {
            alert("所属院系不能为空!");
            return false;
        }
        if (document.getElementById("courseScore").value.trim().length == 0) {
            alert("学分不能为空!");
            return false;
        }
        return true;
    }
script>
html>

DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.demo.dao.StudentMapper">

    <resultMap id="BaseResultMap" type="com.demo.vo.Student" >
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int getTotalRecord() {
        return totalRecord;
    }

    public void setTotalRecord(int totalRecord) {
        this.totalRecord = totalRecord;
    }
            }
            if (isMessyCode(str)) {
                str = new String(str.getBytes("UTF-8"), "ISO-8859-1");
            }
            if (isMessyCode(str)) {
                str = new String(str.getBytes("GB2312"), "ISO-8859-1");
            }
            if (isMessyCode(str)) {
                str = new String(str.getBytes("GBK"), "ISO-8859-1");
            }
            if (isMessyCode(str)) {
                str = new String(str.getBytes("UTF-8"), "GB2312");
            }
            if (isMessyCode(str)) {
                str = new String(str.getBytes("ISO-8859-1"), "GB2312");
            }
            if (isMessyCode(str)) {
                str = new String(str.getBytes("GBK"), "GB2312");
            }
            if (isMessyCode(str)) {
                str = new String(str.getBytes("UTF-8"), "GBK");
            }
            if (isMessyCode(str)) {
                str = new String(str.getBytes("ISO-8859-1"), "GBK");
            }
            if (isMessyCode(str)) {
        <if test="startIndex != null and pageSize != null">
            LIMIT #{startIndex},#{pageSize};
        if>
    select>
    
    <select id="getAllCount" parameterType="java.util.Map" resultType="Integer">
        SELECT COUNT(*) FROM `t_user`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            if>
            1=1
        where>
    select>
mapper>

DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.demo.dao.NoticeMapper">

    <resultMap id="BaseResultMap" type="com.demo.vo.Notice" >
            <result column="id" property="id" />
            <result column="notice_name" property="noticeName" />
            <result column="notice_text" property="noticeText" />
            <result column="notice_type" property="noticeType" />
            <result column="create_date" property="createDate" />
    resultMap>
                    <input type="text" class="form-control" id="studentAge" name="studentAge" value="${vo.studentAge}">
                div>
            div>
        <div class="form-group">
            <label class="col-sm-3 control-label">性别:label>
            <div class="col-sm-5">
                              
                              
            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="studentNumber" name="studentNumber" value="${vo.studentNumber}">
                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="studentClass" name="studentClass" value="${vo.studentClass}">
                div>
            div>
    function check() {
        //根据ID获取值
        if (document.getElementById("studentName").value.trim().length == 0) {
            alert("姓名不能为空!");
            return false;
        }
        if (document.getElementById("studentAge").value.trim().length == 0) {
            alert("年龄不能为空!");
            return false;
        }
        if (document.getElementById("studentNumber").value.trim().length == 0) {
            alert("学号不能为空!");
            return false;
        }
        if (document.getElementById("studentClass").value.trim().length == 0) {
            alert("班级不能为空!");
            return false;
                    <if test ='noticeText != null'>`notice_text`,if>
                    <if test ='noticeType != null'>`notice_type`,if>
                    <if test ='createDate != null'>`create_date`if>
        trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>#{id},if>
                    <if test ='noticeName != null'>#{noticeName},if>
                    <if test ='noticeText != null'>#{noticeText},if>
                    <if test ='noticeType != null'>#{noticeType},if>
                    <if test ='createDate != null'>#{createDate}if>
        trim>
    insert>

    
    <delete id="doRemoveBatch" parameterType="java.util.Collection">
        DELETE FROM `t_notice` WHERE `id` IN
        <foreach collection="list" item="id" separator="," open="(" close=")">
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int getTotalRecord() {
        return totalRecord;
    }

    public void setTotalRecord(int totalRecord) {
        this.totalRecord = totalRecord;
    }

    //--分页逻辑
    //已知数据
    private int pageNum;//当前页,从请求那边传过来。
    private int pageSize;//每页显示的数据条数。
    //需要计算得来
    private int totalPage;    //总页数,通过totalRecord和pageSize计算可以得来
    //开始索引,也就是我们在数据库中要从第几行数据开始拿,有了startIndex和pageSize,
    //就知道了limit语句的两个数据,就能获得每页需要显示的数据了
    private int startIndex;
    //分页显示的页数,比如在页面上显示1,2,3,4,5页,start就为1,end就为5,这个也是算过来的

运行环境

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…均可

适用

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

功能说明

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

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/729852.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-27
下一篇 2022-04-27

发表评论

登录后才能评论

评论列表(0条)

保存