本文主要是介绍(java毕业设计源码)基于java学生日常行为评分管理系统源码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
基于java学生日常行为评分管理系统
项目获取请看文章最底下官网
学生日常行为评分管理系统是基于java编程语言和mysql数据库开发,BS架构的系统,系统主要分为学生,教师,管理员三个角色,其中学生主要功能是查看评分项目和自己的日常行为扣分加分情况;教师可以对学生的日常行为进行记录和考核;管理员可以添加学生,教师,考核项目等。本系统功能齐全,适合作为java毕业设计和java课程设计来参考和学习。
一.技术环境
JDK版本:1.8
IDE工具:eclipse
数据库: mysql
编程语言: Java
tomcat: 8.0
框架:SSM
前端框架:bootstrap
详细技术:HTML+CSS+JS+JSP+JAVA+SSM+MYSQL
二.项目文件(项目获取请看文末官网)
三.系统功能
四.代码示例
package com.lmu.controller;
/*** 和登陆有关的都在这里*/import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.lmu.model.Role;
import com.lmu.model.User;
import com.lmu.service.RoleService;
import com.lmu.service.UserService;
import com.lmu.utils.JsonUtils;
import com.lmu.utils.UserUtils;import org.apache.commons.collections.map.HashedMap;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;import java.io.IOException;
import java.util.HashMap;
import java.util.Map;@Controller("loginController")
@Scope("prototype")
public class LoginController extends ActionSupport {@Autowiredprivate UserService userService;@Autowiredprivate RoleService roleService;private User user;private Map<String, Object> map = new HashMap();public User getUser() {return user;}public void setUser(User user) {this.user = user;}public UserService getUserService() {return userService;}public void setUserService(UserService userService) {this.userService = userService;}/*** 用户登陆* @return*/public void index() throws IOException {User user1 = userService.getUser(user);if (user1 != null){if (user1.getIsSh() == 1){if (user1.getRole().getEnName().equals("admin")){ActionContext.getContext().getSession().put("user", user1);}if (user1.getRole().getEnName().equals("js")){ActionContext.getContext().getSession().put("user1", user1);}if (user1.getRole().getEnName().equals("xs")){ActionContext.getContext().getSession().put("user2", user1);}map.put("flag", 1);map.put("url", "login_indexs.do");map.put("id", user1.getId());JsonUtils.toJson(map);} else {map.put("flag", 2);JsonUtils.toJson(map);}} else {map.put("flag", 3);JsonUtils.toJson(map);}}public String indexs() throws IOException {User u = UserUtils.getUser();if (u != null){ActionContext.getContext().put("user", u);String ss = u.getRole().getEnName();ActionContext.getContext().put("role", u.getRole().getEnName());}return SUCCESS;}//登陆页面public String login() {return SUCCESS;}//退出public String tuichu() {ActionContext ac = ActionContext.getContext();Map session = ac.getSession();session.remove("userName");session.remove("userId");ServletActionContext.getRequest().getSession().invalidate();return "login";}}
五.项目截图
这篇关于(java毕业设计源码)基于java学生日常行为评分管理系统源码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!