开发工具:Eclipse
前端技术:
基础:html+css+JavaScript
框架:JQuery+H-ui
后端技术:Spring+SpringMVC+mybatis
模板引擎:JSP
数据库:mysql 5.7.27
jdk版本:1.8.0_251
tomcat版本:Tomcat 9.0
数据库连接池:druid
一、功能概述
学生管理系统的用户包括学生、教师及管理员。
(1)学生可以对个人的各科成绩进行查询、个人信息修改、选课、修改登录密码等操作。
(2)教师可以对学生信息、教师个人信息、课程信息、成绩等进行管理,实现对这些信息的查询、录入、添加、修改、删除等操作。
(3)管理员可以对学生、教师、课程、成绩信息进行管理,实现对这些信息的查询、录入、添加、修改、删除以及权限管理等操作。
功能结构图:
二、数据库表结构
成绩表(Score):
学生表(student):
课程表(subject):
教师表(teacher):
用户表(user):
三、项目结构
四、配置SSM文件
Spring-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd"
default-lazy-init="true">
<description>Spring Configuration</description>
<!-- 加载配置属性文件 -->
<context:property-placeholder ignore-unresolvable="true" location="classpath:demo.properties" />
<!-- 使用Annotation自动注册Bean,解决事物失效问题:在主容器中不扫描@Controller注解,在SpringMvc中只扫描@Controller注解。 -->
<context:component-scan base-package="com.stusystem.controller"><!-- base-package 如果多个,用“,”分隔 -->
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!-- MyBatis begin -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="typeAliasesPackage" value="com.stusystem.entity"/>
<property name="mapperLocations" value="classpath:/com/stusystem/mappings/**/*.xml"/>
<property name="configLocation" value="classpath:/mybatis-config.xml"></property>
</bean>
<!-- 扫描basePackage下所有以@MyBatisDao注解的接口 -->
<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
<property name="basePackage" value="com.stusystem.dao"/>
</bean>
<!-- 定义事务,用@Transactiona注解表示事物 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 配置 Annotation 驱动,扫描@Transactional注解的类定义事务 -->
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
<!-- MyBatis end -->
<!-- 配置 JSR303 Bean Validator 定义 -->
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
<!-- 数据源配置, 使用 BoneCP 数据库连接池 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass -->
<property name="driverClassName" value="${jdbc.driver}" />
<!-- 基本属性 url、user、password -->
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="${jdbc.pool.init}" />
<property name="minIdle" value="${jdbc.pool.minIdle}" />
<property name="maxActive" value="${jdbc.pool.maxActive}" />
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000" />
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000" />
<property name="validationQuery" value="${jdbc.testSql}" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<!-- 配置监控统计拦截的filters -->
<property name="filters" value="stat" />
</bean>
</beans>
Mybatis-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局参数 -->
<settings>
<!-- 使全局的映射器启用或禁用缓存。 -->
<setting name="cacheEnabled" value="true"/>
<!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载。 -->
<setting name="lazyLoadingEnabled" value="true"/>
<!-- 当启用时,有延迟加载属性的对象在被调用时将会完全加载任意属性。否则,每种属性将会按需要加载。 -->
<setting name="aggressiveLazyLoading" value="true"/>
<!-- 是否允许单条sql 返回多个数据集 (取决于驱动的兼容性) default:true -->
<setting name="multipleResultSetsEnabled" value="true"/>
<!-- 是否可以使用列的别名 (取决于驱动的兼容性) default:true -->
<setting name="useColumnLabel" value="true"/>
<!-- 允许JDBC 生成主键。需要驱动器支持。如果设为了true,这个设置将强制使用被生成的主键,有一些驱动器不兼容不过仍然可以执行。 default:false -->
<setting name="useGeneratedKeys" value="false"/>
<!-- 指定 MyBatis 如何自动映射 数据基表的列 NONE:不隐射 PARTIAL:部分 FULL:全部 -->
<setting name="autoMappingBehavior" value="PARTIAL"/>
<!-- 这是默认的执行类型 (SIMPLE: 简单; REUSE: 执行器可能重复使用prepared statements语句;BATCH: 执行器可以重复执行语句和批量更新) -->
<setting name="defaultExecutorType" value="SIMPLE"/>
<!-- 使用驼峰命名法转换字段。 -->
<setting name="mapUnderscoreToCamelCase" value="true"/>
<!-- 设置本地缓存范围 session:就会有数据的共享 statement:语句范围 (这样就不会有数据的共享 ) defalut:session -->
<setting name="localCacheScope" value="SESSION"/>
<!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER,插入空值时不需要指定类型 -->
<setting name="jdbcTypeForNull" value="NULL"/>
</settings>
</configuration>
spring-mvc.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<description>Spring MVC Configuration</description>
<!-- 加载配置属性文件 -->
<context:property-placeholder ignore-unresolvable="true" location="classpath:demo.properties" />
<!-- 使用Annotation自动注册Bean,只扫描@Controller -->
<context:component-scan base-package="com.stusystem" use-default-filters="false"><!-- base-package 如果多个,用“,”分隔 -->
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!-- 默认的注解映射的支持,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping -->
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager">
<mvc:message-converters register-defaults="true">
<!-- 将StringHttpMessageConverter的默认编码设为UTF-8 -->
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" />
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!-- REST中根据URL后缀自动判定Content-Type及相应的View -->
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="mediaTypes" >
<map>
<entry key="xml" value="application/xml"/>
<entry key="json" value="application/json"/>
</map>
</property>
<property name="ignoreAcceptHeader" value="true"/>
<property name="favorPathExtension" value="true"/>
</bean>
<!-- 定义视图文件解析 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/"/>
<!-- <property name="suffix" value="${web.view.suffix}"/> -->
<property name="suffix" value=".jsp"/>
</bean>
<!-- 对静态资源文件的访问, 将无法mapping到Controller的path交给default servlet handler处理 -->
<mvc:default-servlet-handler />
<!-- 静态资源映射 -->
<mvc:resources mapping="/static/**" location="/static/" cache-period="31536000"/>
<!-- 定义无Controller的path<->view直接映射 -->
<mvc:view-controller path="/" view-name="redirect:${web.view.index}"/>
<mvc:interceptors>
<!--多个拦截器,顺序执行 -->
<!-- 登陆认证拦截器 -->
<mvc:interceptor>
<mvc:mapping path="/**"/>
<bean class="com.stusystem.interceptor.LoginInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>
</beans>
五、配置web.xml和demo.properties
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>stusystem_3</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/spring-context*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>springServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/spring-mvc*.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>DruidStatView</servlet-name>
<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
<init-param>
<param-name>allow</param-name>
<param-value>127.0.0.1</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DruidStatView</servlet-name>
<url-pattern>/druid/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>600</session-timeout>
</session-config>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/js/*</url-pattern>
<url-pattern>/css/*</url-pattern>
<url-pattern>/images/*</url-pattern>
<url-pattern>/font/*</url-pattern>
<url-pattern>/assets/*</url-pattern>
<url-pattern>/lib/*</url-pattern>
</servlet-mapping>
</web-app>
demo.properties
#============================#
#===== Database settings ====#
#============================#
#mysql database setting
jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/stusystem?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=123456
#pool settings
jdbc.pool.init=1
jdbc.pool.minIdle=3
jdbc.pool.maxActive=20
#jdbc.testSql=SELECT 'x'
jdbc.testSql=SELECT 'x' FROM DUAL
web.view.prefix=/
web.view.suffix=.jsp
web.view.index=/StuSystem/user/login
六、各个模块代码
**
(1)用户模块:
**
UserBean.java:
package com.stusystem.entity;
import org.apache.ibatis.type.Alias;
import org.springframework.stereotype.Component;
@Alias("userbean")
@Component
public class Userbean {
private String userName;
private int userId;
private String admin;
private String password;
private String xmm;
public String getXmm() {
return xmm;
}
public void setXmm(String xmm) {
this.xmm = xmm;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getAdmin() {
return admin;
}
public void setAdmin(String admin) {
this.admin = admin;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
UserDao.java:
package com.stusystem.dao;
import com.stusystem.entity.Userbean;
public interface UserDao {
//验证登录信息
public Userbean getUsrInfoByNameAndPsw(Userbean userbean);
//修改密码
public void mmxg(Userbean userbean);
}
UserDao.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- namesapce ,DAO的package路径 -->
<mapper namespace="com.stusystem.dao.UserDao">
<!-- 根据用户输入的用户名和密码查询是否存在此用户 -->
<select id="getUsrInfoByNameAndPsw" parameterType="userbean" resultType="userbean">
select * from user where user_id=#{userId} and password=#{password} and admin=#{admin}
</select>
<!-- 修改登录用户的密码 -->
<update id="mmxg" parameterType="userbean">
UPDATE user SET password = #{xmm} WHERE (user_id=#{userId})
</update>
</mapper>
UserController.java:
package com.stusystem.controller;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.stusystem.dao.UserDao;
import com.stusystem.entity.Userbean;
@Controller
@RequestMapping(value = "user")
public class UserController {
@Autowired
private UserDao userDao;
// ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:spring-context.xml");
// UserDao userDao = (UserDao) applicationContext.getBean("userDao");
//返回登陆界面
//验证用户的用户名和密码是有和数据库中的匹配
@RequestMapping(value = {
"/login"})
public String userlogin() {
return "login";
}
//登陆验证
@RequestMapping(value = {
"/loginyanzheng"})
public void loginyanzheng(Userbean userbean,HttpServletResponse response,HttpServletRequest request) throws IOException {
Userbean user = userDao.getUsrInfoByNameAndPsw(userbean);
if(user==null){
response.getWriter().println("{\"status\":0,\"msg\":\"用户名或密码有误!\"}");
}else{
// 用户的信息存放到session中。
HttpSession session = request.getSession();
session.setAttribute("userbean", user);
response.getWriter().println("{\"status\":1,\"url\":\"index\"}");
}
}
//返回系统主界面
@RequestMapping(value = {
"/index"})
public String index() {
return "index";
}
//返回关于页面
@RequestMapping(value = {
"/gy"})
public String guanyu() {
return "gy";
}
//返回密码修改页面
@RequestMapping(value = {
"/dlmmxg"})
public String dlmmxg() {
return "dlmmxg";
}
//修改登录密码
@RequestMapping(value = {
"/mmxg"})
public String mmxg(Userbean userbean,HttpServletResponse response,HttpServletRequest request){
Userbean user = userDao.getUsrInfoByNameAndPsw(userbean);
if(user==null){
request.setAttribute("status", '0');
}else{
userDao.mmxg(userbean);
request.setAttribute("status", '1');
}
return "dlmmxg";
}
//退出系统
@RequestMapping(value = {
"/loginout"})
public String loginout(HttpServletRequest request){
HttpSession session = request.getSession();
session.invalidate();
return "login";
}
}
login.jsp
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="content-type" content="text/html">
<meta charset="UTF-8">
<title>学生成绩管理系统|登录</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/host.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/animate.min.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/bootstrap.min.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/font-awesome.min.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/style.min.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/iconfont.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/validator-0.7.3/jquery.validator.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/sweetalert/sweetalert.css">
<script src="<%=request.getContextPath()%>/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/validator-0.7.3/jquery.validator.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/validator-0.7.3/local/zh_CN.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/host.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript">
function login() {
var userid = document.getElementById("userid").value;
var password = document.getElementById("password").value;
var list = document.getElementsByName("inlineRadioOptions");
var admin = null;
if(!list[0].checked&&!list[1].checked&&!list[2].checked){
return;
}
for(var i = 0 ; i < list.length ; i++){
if(list[i].checked){
admin = list[i].value;
}
}
$.ajax({
type : "POST",
data : "userId=" + userid + "&password=" + password +"&admin=" + admin,
dataType : "json",
url : "<%=request.getContextPath()%>/user/loginyanzheng",
success : function(result) {
if (result.status == 0) {
swal("哦豁","用户名或密码有误,请重新输入!","error");
} else {
swal({
title:"太帅了",text:"登录成功,进入系统!",type:"success"},
function () {
location.href = "/StuSystem_3/user/index";
});
}
}
});
}
</script>
</head>
<body bgcolor="#FFFFFF">
<div class="middle-box text-center loginscreen ">
<div >
<div class="animated animated lightSpeedIn ">
<i class="icon iconfont">󰀨</i>
</div>
<h3>欢迎使用 学生成绩管理系统</h3>
<form class=" animated rollIn" data-validator-option="{theme:'yellow_right_effect',stopOnError:true}">
<div class="form-group">
<input type="text" class="form-control" placeholder="用户名" data-rule="用户名:required;digits" id = "userid">
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="密码" data-rule="密码:required;password" id = "password">
</div>
<fieldset>
<label class="radio-inline" >
<input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="1" data-rule="checked"> 管理员
</label>
<label class="radio-inline">
<input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="2" > 教师
</label>
<label class="radio-inline">
<input type="radio" name="inlineRadioOptions" id="inlineRadio3" value="3" > 学生
</label>
</fieldset>
<br/>
<br/>
<button type="submit" class="btn btn-primary block full-width " onclick="login();">登 录</button>
</form>
<br/>
<br/>
<div class = "animated bounceInLeft">
</div>
</div>
</div>
<div class="part"></div>
</body>
</html>
index.jsp
<!DOCTYPE HTML>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>学生成绩管理系统|首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<%=request.getContextPath()%>/assets/css/dpl-min.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/assets/css/bui-min.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/assets/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var index = layer.load(0, {
shade: false}); //0代表加载的风格,支持0-2
</script>
</head>
<body>
<div class="header">
<div class="dl-title"><span class="">学生成绩管理系统</span></div>
<div class="dl-log">欢迎您,<span class="dl-log-user">${userbean.userName}</span>
<c:choose>
<c:when test="${userbean.admin == 1}">
<span class="admin">(管理员)</span>
</c:when>
</c:choose>
<c:choose>
<c:when test="${userbean.admin == 2}">
<span class="admin">(教师)</span>
</c:when>
</c:choose>
<c:choose>
<c:when test="${userbean.admin == 3}">
<span class="admin">(学生)</span>
</c:when>
</c:choose>
<a href="loginout" title="退出系统" class="dl-log-quit">[退出]</a>
</div>
</div>
<div class="content">
<div class="dl-main-nav">
<ul id="J_Nav" class="nav-list ks-clear">
<li class="nav-item dl-selected"><div class="nav-item-inner nav-storage">首页</div></li>
</ul>
</div>
<ul id="J_NavContent" class="dl-tab-conten">
</ul>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/assets/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/assets/js/bui-min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/assets/js/config-min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/lib/layer/1.9.3/layer.js"></script>
<script>
//学生登录
if('${userbean.admin}'=='3'){
BUI.use('common/main',function(){
var config = [{
id:'menu',
homePage:'gy',
menu:[{
text:'学生操作',
items:[
{
id:'cjcx',text:'成绩查询',href:'/StuSystem_3/score/xsgrcjcx?studentId=' + '${userbean.userId}'},
{
id:'xsgrkcgl',text:'学生个人课程管理',href:'/StuSystem_3/score/scoreone?page=1&studentId=' + '${userbean.userId}' },
{
id:'xsgrxxgl',text:'学生个人信息管理',href:'/StuSystem_3/student/studentone?stuId=' + '${userbean.userId}' },
{
id:'dlmmxg',text:'登录密码修改',href:'/StuSystem_3/user/dlmmxg'},
{
id:'gy',text:'关于',href:'gy'}
]
}]
}];
new PageUtil.MainPage({
modulesConfig : config
});
});
}
//教师登录
if('${userbean.admin}'=='2'){
BUI.use('common/main',function(){
var config = [{
id:'menu',
homePage:'gy',
menu:[{
text:'教师操作',
items:[
{
id:'xsxxgl',text:'学生信息管理',href:'/StuSystem_3/teacher/teacherlist?page=1'},
{
id:'kcxxgl',text:'课程信息管理',href:'/StuSystem_3/student/studentlist?page=1'},
{
id:'jsgrxxgl',text:'教师个人信息管理',href:'/StuSystem_3/teacher/teacherone?teacherId='+'${userbean.userId}'},
{
id:'xscjgl',text:'学生成绩管理',href:'/StuSystem_3/score/scorelist?page=1'},
{
id:'dlmmxg',text:'登录密码修改',href:'/StuSystem_3/user/dlmmxg'},
{
id:'gy',text:'关于',href:'gy'}
]
}]
}];
new PageUtil.MainPage({
modulesConfig : config
});
});
}
//管理员登录
if('${userbean.admin}'=='1'){
BUI.use('common/main',function(){
var config = [{
id:'menu',
homePage:'gy',
menu:[{
text:'管理员操作',
items:[
{
id:'jsxxgl',text:'教师信息管理',href:'/StuSystem_3/teacher/teacherlist?page=1'},
{
id:'xsxxgl',text:'学生信息管理',href:'/StuSystem_3/student/studentlist?page=1'},
{
id:'kcxxgl',text:'课程信息管理',href:'/StuSystem_3/subject/subjectlist?page=1'},
{
id:'xscjgl',text:'学生成绩管理',href:'/StuSystem_3/score/scorelist?page=1'},
{
id:'dlmmxg',text:'登录密码修改',href:'/StuSystem_3/user/dlmmxg'},
{
id:'gy',text:'关于',href:'gy'}
]
}]
}];
new PageUtil.MainPage({
modulesConfig : config
});
});
}
</script>
</body>
</html>
dlmmxg.jsp
<!DOCTYPE HTML>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<%=request.getContextPath()%>/css/H-ui.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/H-ui.1.x.patch.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/sweetalert/sweetalert.css">
<script src="<%=request.getContextPath()%>/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/lib/Validform/5.3.2/Validform.js"></script>
<script type="text/javascript"