• 大小: 14.63MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-14
  • 语言: 其他
  • 标签: javassm  

资源简介

学生管理系统(springMVC+MyBatis),包含数据库和前端界面代码

资源截图

代码片段和文件信息

package cn.ylcto.student.action;

import cn.ylcto.student.service.IAdminService;
import cn.ylcto.student.vo.Admin;
import cn.ylcto.util.MD5Code;
import cn.ylcto.util.action.DefaultAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;

@Controller
@RequestMapping(value = “/pages/back/*“)
public class AdminLoginAction extends DefaultAction {
    @Resource
    private IAdminService adminService;

    @RequestMapping(value = “admin_login“)
    public ModelAndView login(HttpServletRequest requestAdmin admin){
        ModelAndView mav = new ModelAndView(super.getResource(“pages.forward“));
        try {
            // 实现登录密码加盐操作
            admin.setPassword(new MD5Code().getMD5ofStr(admin.getPassword()+admin.getEmail()));
            Admin vo = this.adminService.login(admin); // 登录成功后还要取得最后一次登录日期
            if (vo != null){
                super.setMsgAndPath(mav“admin.insert.success““admin.login.success“);
                request.getSession().setAttribute(“email“vo.getEmail());
                request.getSession().setAttribute(“lastdate“new SimpleDateFormat(“yyyy-MM-dd“).format(vo.getLastdate())); // 取得最后一次登录日期操作
            }else{
                super.setMsgAndPath(mav“admin.insert.failure““admin.login.failure“);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mav;
    }

    @RequestMapping(value = “admin_logout“)
    public ModelAndView logout(HttpServletRequest request){
        ModelAndView mav = new ModelAndView(super.getResource(“pages.forward“));
        request.getSession().invalidate(); // 表示session失效
        super.setMsgAndPath(mav“admin.logout.success““admin.logout.failure“);
        return mav;
    }
    @Override
    public String getText() {
        return “管理员“;
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        296  2017-04-12 23:13  studentpro\.idea\artifacts\studentpro_war.xml

     文件       3940  2017-04-12 23:22  studentpro\.idea\artifacts\studentpro_war_exploded.xml

     文件        645  2017-04-13 16:42  studentpro\.idea\compiler.xml

     文件        200  2017-04-12 23:12  studentpro\.idea\encodings.xml

     文件        232  2017-04-13 11:22  studentpro\.idea\kotlinc.xml

     文件        465  2017-04-12 23:22  studentpro\.idea\libraries\Maven__c3p0_c3p0_0_9_1_2.xml

     文件        594  2017-04-12 23:22  studentpro\.idea\libraries\Maven__commons_beanutils_commons_beanutils_1_9_2.xml

     文件        616  2017-04-12 23:22  studentpro\.idea\libraries\Maven__commons_collections_commons_collections_3_2_1.xml

     文件        605  2017-04-12 23:22  studentpro\.idea\libraries\Maven__commons_fileupload_commons_fileupload_1_3_2.xml

     文件        503  2017-04-12 23:22  studentpro\.idea\libraries\Maven__commons_io_commons_io_2_5.xml

     文件        525  2017-04-12 23:22  studentpro\.idea\libraries\Maven__commons_lang_commons_lang_2_6.xml

     文件        572  2017-04-12 23:22  studentpro\.idea\libraries\Maven__commons_logging_commons_logging_1_1_3.xml

     文件        598  2017-04-12 23:22  studentpro\.idea\libraries\Maven__com_mchange_mchange_commons_java_0_2_12.xml

     文件        578  2017-04-12 23:22  studentpro\.idea\libraries\Maven__javax_servlet_javax_servlet_api_3_1_0.xml

     文件        473  2017-04-12 23:22  studentpro\.idea\libraries\Maven__javax_servlet_jstl_1_2.xml

     文件        455  2017-04-12 23:14  studentpro\.idea\libraries\Maven__junit_junit_4_12.xml

     文件        469  2017-04-12 23:22  studentpro\.idea\libraries\Maven__log4j_log4j_1_2_17.xml

     文件        567  2017-04-12 23:22  studentpro\.idea\libraries\Maven__mysql_mysql_connector_java_5_0_8.xml

     文件        512  2017-04-12 23:22  studentpro\.idea\libraries\Maven__net_sf_ezmorph_ezmorph_1_0_6.xml

     文件        521  2017-04-12 23:22  studentpro\.idea\libraries\Maven__net_sf_json_lib_json_lib_jdk15_2_4.xml

     文件        542  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_aspectj_aspectjweaver_1_8_9.xml

     文件        532  2017-04-12 23:14  studentpro\.idea\libraries\Maven__org_hamcrest_hamcrest_core_1_3.xml

     文件        500  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_mybatis_mybatis_3_4_1.xml

     文件        549  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_mybatis_mybatis_spring_1_3_0.xml

     文件        529  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_quartz_scheduler_quartz_2_2_3.xml

     文件        513  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_slf4j_slf4j_api_1_7_21.xml

     文件        541  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_slf4j_slf4j_log4j12_1_7_21.xml

     文件        609  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_springframework_spring_aop_4_3_3_RELEASE.xml

     文件        637  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_springframework_spring_aspects_4_3_3_RELEASE.xml

     文件        623  2017-04-12 23:22  studentpro\.idea\libraries\Maven__org_springframework_spring_beans_4_3_3_RELEASE.xml

............此处省略477个文件信息

评论

共有 条评论

相关资源