为了账号安全,请及时绑定邮箱和手机立即绑定

JSP+Servlet培训班作业管理系统[22] -完结篇之源代码终结

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>workUpdate.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <form action="/HomeworkSystem/ActionServlet?method=save&entityType=Work" method="post">
        <div id="content_top">
            作业信息更新
        </div><!-- user_top end -->
        <div id="content_mid">
            <table class="table_theme1">
                <tr>
                    <td>所属课程:</td>
                    <td>
                        <select name="workCourse">
                            <c:forEach items="${courses}" var="item">
                                <option value="${item.courseId}">${item.courseName}</option>
                            </c:forEach>    
                        </select>
                    </td>
                    <td>作业题目:</td>
                    <td>
                        <input type="text" name="workTitle" value="${work.workTitle}"/>
                    </td>
                </tr>
            </table>
        </div><!-- user_mid end -->
        <div id="content_bottom">
            <input type="submit" value="保存"></input>
        </div><!-- "user_bottom" end -->
      </form>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>courseManageByStudent.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <div id="content_top">
        学生选课
    </div><!-- user_top end -->
    <div id="content_mid">
        <table class="table_theme1">
            <thead>
            <tr>
                <th>课程编号</th>
                <th>课程名称</th>
                <th>课程教师</th>
                <th>操作</th>
            </tr>
            </thead>
            <c:forEach items="${courses}" var="item">
                <tr>
                    <td>${item.courseId}</td>
                    <td>${item.courseName}</td>
                    <td>${item.courseUser.userName}</td>
                    <td><a href="/HomeworkSystem/ActionServlet?method=save&entityType=Lesson&courseId=${item.courseId}">选课</a></td>
                </tr>
            </c:forEach>    
            <tr><td colspan="5">共${maxPage}页  当前是第${currentPage}页   <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Course&page=${currentPage-1}">上一页</a>  <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Course&page=${currentPage+1}">下一页</a></td></tr>
        </table>
    </div><!-- user_mid end -->
    <div id="content_bottom">

    </div><!-- "user_bottom" end -->
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>courseManageByTeacher.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <div id="content_top">
        课程列表
    </div><!-- user_top end -->
    <div id="content_mid">
        <table class="table_theme1">
            <thead>
            <tr>
                <th>课程编号</th>
                <th>课程名称</th>
                <th>课程教师</th>
                <th>操作</th>
                <th>操作</th>
            </tr>
            </thead>
            <c:forEach items="${courses}" var="item">
                <tr>
                    <td>${item.courseId}</td>
                    <td>${item.courseName}</td>
                    <td>${item.courseUser.userName}</td>
                    <td><a href="/HomeworkSystem/ActionServlet?method=edit&entityType=Course&entityId=${item.courseId}">编辑</a></td>
                    <td><a href="/HomeworkSystem/ActionServlet?method=view&entityType=Work&byCourseId=${item.courseId}">查看课程作业</a></td>
                </tr>
            </c:forEach>    
            <tr><td colspan="5">共${maxPage}页  当前是第${currentPage}页   <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Course&page=${currentPage-1}">上一页</a>  <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Course&page=${currentPage+1}">下一页</a></td></tr>
        </table>
    </div><!-- user_mid end -->
    <div id="content_bottom">
        <a href="/HomeworkSystem/ActionServlet?method=add&entityType=Course">新增</a>
    </div><!-- "user_bottom" end -->
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>courseUpdate.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <form action="/HomeworkSystem/ActionServlet?method=save&entityType=Course" method="post">
        <div id="content_top">
            课程信息更新
        </div><!-- user_top end -->
        <div id="content_mid">
            <table class="table_theme1">
                <tr>
                    <td>课程名称:</td>
                    <td>
                        <input type="text" name="courseName" value="${course.courseName}"/>
                        <input type="hidden" name="entityId" value="${course.courseId}"/>
                    </td>
                </tr>
            </table>
        </div><!-- user_mid end -->
        <div id="content_bottom">
            <input type="submit" value="保存"></input>
        </div><!-- "user_bottom" end -->
      </form>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>index.jsp</title>
    <link href="css/index.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <div id="main">
        <div id="top">
            <div id="top_title">
                猫哥培训班作业管理系统
            </div><!-- 标题部分 -->
            <div id="top_info">
                欢迎您,尊敬的:${sessionUser.userName}
            </div><!-- 登录用户信息部分 -->
        </div><!-- top部分是标题栏 -->
        <div id="left">
            <ul>
                <c:forEach items="${sessionRoleMenu}" var="menu">
                <li>
                    <a href="/HomeworkSystem/ActionServlet?method=${menu[1]}&entityType=${menu[2]}">${menu[0]}</a>
                </li>
                </c:forEach>
            </ul>
        </div><!-- left部分是菜单栏 -->
        <div id="right">
            <c:if test="${empty actionUrl}">
                欢迎来到猫哥培训班管理系统
            </c:if>
            <c:if test="${not empty actionUrl}">
                <jsp:include page="${actionUrl}" flush="true"></jsp:include>
            </c:if>
        </div><!-- right部分是具体内容显示区 -->
    </div>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>jobManageByStudent.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <div id="content_top">
        做作业 do my job
    </div><!-- user_top end -->
    <div id="content_mid">
        <table class="table_theme1">
            <thead>
                <tr>
                <th>作业编号</th>
                <th>题目</th>
                <th>操作</th>
                </tr>
            </thead>
            <c:forEach items="${jobs}" var="item">
                <tr>
                    <td>${item.jobId}</td>
                    <td>${item.jobWork.workTitle}</td>
                    <td><a href="/HomeworkSystem/ActionServlet?method=editJobContent&entityType=Job&entityId=${item.jobId}">做作业</a></td>
                </tr>
            </c:forEach>    
            <tr><td colspan="4">共${maxPage}页  当前是第${currentPage}页   <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Job&page=${currentPage-1}">上一页</a>  <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Job&page=${currentPage+1}">下一页</a></td></tr>
        </table>
    </div><!-- user_mid end -->
    <div id="content_bottom">

    </div><!-- "user_bottom" end -->
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>jobManageByTeacher.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <div id="content_top">
        作业批阅
    </div><!-- user_top end -->
    <div id="content_mid">
        <table class="table_theme1">
            <thead>
                <tr>
                <th>作业编号</th>
                <th>题目</th>
                <th>学生</th>
                <th>提交时间<th>
                <th>操作</th>
                </tr>
            </thead>
            <c:forEach items="${jobs}" var="item">
                <tr>
                    <td>${item.jobId}</td>
                    <td>${item.jobWork.workTitle}</td>
                    <td>${item.jobUser.userName}</td>
                    <td>${item.jobTime}</td>
                    <td><a href="/HomeworkSystem/ActionServlet?method=editJobScore&entityType=Job&entityId=${item.jobId}">批阅作业</a></td>
                </tr>
            </c:forEach>    
            <tr><td colspan="5">共${maxPage}页  当前是第${currentPage}页   <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Job&page=${currentPage-1}">上一页</a>  <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Job&page=${currentPage+1}">下一页</a></td></tr>
        </table>
    </div><!-- user_mid end -->
    <div id="content_bottom">

    </div><!-- "user_bottom" end -->
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>jobUpdateByStudent.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <form action="/HomeworkSystem/ActionServlet?method=save&entityType=Job" method="post">
        <div id="content_top">
            做作业
        </div><!-- user_top end -->
        <div id="content_mid">
            <table class="table_theme1">
                <tr>
                    <td>作业编号:</td>
                    <td>
                        ${job.jobId}
                        <input type="hidden" name="entityId" value="${job.jobId}"/>
                    </td>
                </tr>
                <tr>
                    <td>题目:</td>
                    <td>
                        ${job.jobWork.workTitle}
                        <input type="hidden" name="workId" value="${job.jobWork.workId}"/>
                    </td>
                </tr>
                <tr>
                    <td>作业内容:</td>
                    <td>
                        <textarea name="jobContent" rows="8" cols="30"></textarea>
                    </td>
                </tr>
            </table>
        </div><!-- user_mid end -->
        <div id="content_bottom">
            <input type="submit" value="提交作业"></input>
        </div><!-- "user_bottom" end -->
      </form>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>jobUpdateByTeacher.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <form action="/HomeworkSystem/ActionServlet?method=save&entityType=Job" method="post">
        <div id="content_top">
            作业批阅
        </div><!-- user_top end -->
        <div id="content_mid">
            <table class="table_theme1">
                <tr>
                    <td>作业编号:</td>
                    <td>
                        ${job.jobId}
                        <input type="hidden" name="entityId" value="${job.jobId}"/>
                    </td>
                </tr>
                <tr>
                    <td>题目:</td>
                    <td>
                        ${job.jobWork.workTitle}
                        <input type="hidden" name="workId" value="${job.jobWork.workId}"/>
                    </td>
                </tr>
                <tr>
                    <td>作业内容:</td>
                    <td>
                        <textarea name="jobContent" rows="8" cols="30" >${job.jobContent}</textarea>
                    </td>
                </tr>
                    <tr>
                    <td>打分:</td>
                    <td>
                        <select name="jobScore">
                            <option value="0">优秀</option>
                            <option value="1">良好</option>
                            <option value="2">合格</option>
                            <option value="3">不合格</option>
                        </select>
                    </td>
                </tr>
            </table>
        </div><!-- user_mid end -->
        <div id="content_bottom">
            <input type="submit" value="确认"></input>
        </div><!-- "user_bottom" end -->
      </form>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>login.jsp</title>
  </head>
  <body>
    <form id="mainForm" method="post" action="/HomeworkSystem/ActionServlet?method=login&entityType=User">
        请输入用户编号:<input type="text" name="userId" />
        <br/>
        请输入密码:<input type="password" name="userPassword"/>  
        <br/>
        <input type="submit" value="登录"/>
    </form>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>tip.jsp</title>
  </head>
  <body>
    <c:if test="${empty tipInfo}">
        欢迎使用猫哥培训班管理系统
    </c:if>
    <c:if test="${not empty tipInfo}">
        提示信息:${tipInfo}<br/>
    </c:if>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>userManage.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <div id="content_top">
        人员管理
    </div><!-- user_top end -->
    <div id="content_mid">
        <table class="table_theme1">
            <thead>
                <tr>
                <th>人员编码</th>
                <th>姓名</th>
                <th>角色</th>
                <th>操作</th>
                <th>操作</th>
                </tr>
            </thead>
            <c:forEach items="${users}" var="item">
                <tr>
                    <td>${item.userId}</td>
                    <td>${item.userName}</td>
                    <td>${item.userRole.roleName}</td>
                    <td><a href="/HomeworkSystem/ActionServlet?method=edit&entityType=User&entityId=${item.userId}">编辑</a></td>
                    <td><a href="/HomeworkSystem/ActionServlet?method=delete&entityType=User&entityId=${item.userId}">删除</a></td>
                </tr>
            </c:forEach>    
            <tr><td colspan="5">共${maxPage}页  当前是第${currentPage}页   <a href="/HomeworkSystem/ActionServlet?method=view&entityType=User&page=${currentPage-1}">上一页</a>  <a href="/HomeworkSystem/ActionServlet?method=view&entityType=User&page=${currentPage+1}">下一页</a></td></tr>
        </table>
    </div><!-- user_mid end -->
    <div id="content_bottom">
        <a href="/HomeworkSystem/ActionServlet?method=add&entityType=User">新增</a>
    </div><!-- "user_bottom" end -->
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>userUpdate.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <form action="/HomeworkSystem/ActionServlet?method=save&entityType=User" method="post">
        <div id="content_top">
            人员信息更新
        </div><!-- user_top end -->
        <div id="content_mid">
            <table class="table_theme1">
                <tr>
                    <td>姓名:</td>
                    <td>
                        <input type="text" name="userName" value="${user.userName}"/>
                        <input type="hidden" name="entityId" value="${user.userId}"/>
                    </td>
                </tr>
                <tr>
                    <td>密码:</td>
                    <td>
                        <input type="text" name="userPassword" value="${user.userPassword}"/>
                    </td>
                </tr>
                <tr>
                    <td>角色:</td>
                    <td>
                        <select name="userRole"><!-- 编辑情况下,默认显示编辑用户的角色的功能,待后续优化项目时再讲如何实现 -->
                            <option value="1">校长</option>
                            <option value="2">老师</option>
                            <option value="3">学生</option>
                        </select>
                    </td>
                </tr>
            </table>
        </div><!-- user_mid end -->
        <div id="content_bottom">
            <input type="submit" value="保存"></input>
        </div><!-- "user_bottom" end -->
      </form>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>workManage.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <div id="content_top">
        课程作业列表
    </div><!-- user_top end -->
    <div id="content_mid">
        <table class="table_theme1">
            <thead>
                <tr>
                <th>作业编号</th>
                <th>作业题目</th>
                <th>所属课程</th>
                <th>发布时间</th>
                </tr>
            </thead>
            <c:forEach items="${works}" var="item">
                <tr>
                    <td>${item.workId}</td>
                    <td>${item.workTitle}</td>
                    <td>${item.workCourse.courseName}</td>
                    <td>${item.workTime}</td>
                </tr>
            </c:forEach>    
            <tr><td colspan="5">共${maxPage}页  当前是第${currentPage}页   <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Work&byCourseId=${byCourseId}&page=${currentPage-1}">上一页</a>  <a href="/HomeworkSystem/ActionServlet?method=view&entityType=Work&byCourseId=${byCourseId}&page=${currentPage+1}">下一页</a></td></tr>
        </table>
    </div><!-- user_mid end -->
    <div id="content_bottom">
        <a href="/HomeworkSystem/ActionServlet?method=add&entityType=Work">发布新作业</a>
    </div><!-- "user_bottom" end -->
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!-- 使用c:标签需要添加本行代码 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>workUpdate.jsp</title>
    <link href="css/content.css" type="text/css" rel="stylesheet"/>
    <link href="css/table.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
    <form action="/HomeworkSystem/ActionServlet?method=save&entityType=Work" method="post">
        <div id="content_top">
            作业信息更新
        </div><!-- user_top end -->
        <div id="content_mid">
            <table class="table_theme1">
                <tr>
                    <td>所属课程:</td>
                    <td>
                        <select name="workCourse">
                            <c:forEach items="${courses}" var="item">
                                <option value="${item.courseId}">${item.courseName}</option>
                            </c:forEach>    
                        </select>
                    </td>
                    <td>作业题目:</td>
                    <td>
                        <input type="text" name="workTitle" value="${work.workTitle}"/>
                    </td>
                </tr>
            </table>
        </div><!-- user_mid end -->
        <div id="content_bottom">
            <input type="submit" value="保存"></input>
        </div><!-- "user_bottom" end -->
      </form>
  </body>
</html>
点击查看更多内容
2人点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消