一、项目介绍
本系统目标是实现信息管理系统所需的各种基本功能,能 够很好的实现学生信息增加、删除、查询、修改等功能,还可以实现管理员进行对专业、学院、班级等模块进行管理。分为普通用户模式和管理员模式,管理员可以对相关信息进行管理(增删改查),普通用户只能查询和浏览信息。采用MVC模式,JSP+Servlet+Java Bean。学生信息可以导出为Excel表格。
数据库系统:My Sql
开发工具: Eclipse
开发环境:JDK+Tomcat
二、运行效果截图
1.登录界面
部分代码如下:
<div id="loginDiv">
<form action="loginservlet" id="form" method="post">
<h1 style="text-align: center;color: aliceblue;">立即登录</h1>
<p>用户名:<input id="username" name="username" type="text"></p>
<p>密码:<input id="password" name="password" type="password" placeholder="密码长度至少为6位" style="margin-left: 30px;"></p>
<p style="text-align: center;">
<input type="radio" class="i1" name="user_type" value="0" ><span style="padding-left: 10px;">学生</span>
<input type="radio" class="i1" name="user_type" value="1"><span style="padding-left: 10px;">管理员</span>
</p>
<div style="text-align: center;margin-top: 30px;">
<input type="submit" class="button" value="登录" >
<input type="button" class="button" value="注册" onclick="register_click()">
<p style="color:red; text-align:center">${requestScope.login_errMsg}</p>
</div>
</form>
<script>
//注册按钮跳转
function register_click(){
window.location.href="register.jsp";
}
</script>
</div>
2.管理员模式
3.学生信息查询和管理(对学生信息增删改查,支持按学生姓名查询、按班级查询、按学院查询)
部分代码:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
ArrayList <StudentBean>students_list=new ArrayList<StudentBean>();
StudentDao student=new StudentDao();
students_list=student.get_allStudentInformation();
request.setAttribute("allStudentInformation", students_list);
request.getRequestDispatcher("showStudentInformation.jsp").forward(request, response);
}
部分代码:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
StudentDao dao=new StudentDao();
ArrayList <StudentBean> studentResult=new ArrayList<StudentBean>();
String findType=request.getParameter("findType");
String findInformation=request.getParameter("findInformation");
if(findType==null){
request.setAttribute("findErroeMsg", "请选择查询类型");
}
else if (findType.equals("studentId")) {
StudentBean student=new StudentBean();
student=dao.find_byId(findInformation);
studentResult.add(student);
}
else if(findType.equals("classId")) {
studentResult=dao.find_byClass(findInformation);
}
else if(findType.equals("name")) {
studentResult=dao.find_byName(findInformation);
}
else {
}
request.setAttribute("studentResult", studentResult);
request.getRequestDispatcher("findStudentInformation.jsp").forward(request, response);
}
总结
获取源码及报告请添加本人:QQ:515681206(注明来意)
更多推荐