• 大小: 8.74MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-21
  • 语言: 其他
  • 标签: spingmvc  mybatis  mysql  

资源简介

1. 登录验证,(同时ajax的异步验证) 2. 老师和学生登录后有不同的界面 3. 学生可以给老师留言,并查看自己留言的状态 4. 老师可以对学生进行增删改查,对留言进行处理 5.资源中提供数据库

资源截图

代码片段和文件信息

package controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import entity.Message;
import entity.User;
import service.MessageService;
import service.UserService;
import service.impl.MessageServiceImpl;
import service.impl.UserServiceImpl;

@Controller
public class MessageController {
MessageService service = new MessageServiceImpl();

UserService uservice = new UserServiceImpl();
@RequestMapping(“/leaveMsg“)
public String leaveMsg(@RequestParam(“sidFrom“)int sidFrom@RequestParam(“content“)String content
HttpServletRequest request
HttpSession session) {
String info =““;
if (service.sendMsg(sidFrom content)) {
info =“成功“;
System.out.println(info);
List slist = service.getMessageById(sidFrom); 
User u = uservice.getUserById(sidFrom);
session.setAttribute(“user“u);
request.setAttribute(“slist“ slist);
}else {
info =“失败“;
}
request.setAttribute(“info“ info);
return “student“;
}
//班主任操作
@RequestMapping(“msg/{type}/deal“)
public String agree(@RequestParam(“mid“)int mid

@PathVariable(“type“) String type
HttpServletRequest request) {
String info =““;
if (service.deal(mid type)) {
info=“操作成功“;
}else {
info = “操作失败“;
}
request.setAttribute(“info“ info);
return “redirect:/initTeacher.action“;
}

@RequestMapping(“/readMessage“)
public void readMessage() {
service.readMessage();
}

@RequestMapping(“/feedBack“)
public String feedBack(int midRedirectAttributes ra) {
String info = ““;
if (service.feedBack(mid)) {
info = “撤回成功“;
}else {
info = “撤回失败“;
}
ra.addFlashAttribute(info);
return “redirect:/initStudent.action“;
}
}

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

     文件       4792  2020-03-25 10:14  springmvc_2020\.classpath

     文件        914  2020-03-25 08:29  springmvc_2020\.project

     文件        567  2020-03-25 08:29  springmvc_2020\.settings\.jsdtscope

     文件        364  2020-03-25 08:29  springmvc_2020\.settings\org.eclipse.jdt.core.prefs

     文件        494  2020-03-25 08:32  springmvc_2020\.settings\org.eclipse.wst.common.component

     文件        345  2020-03-25 08:29  springmvc_2020\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2020-03-25 08:29  springmvc_2020\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2020-03-25 08:29  springmvc_2020\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       3346  2020-03-27 10:10  springmvc_2020\build\classes\controller\MessageController.class

     文件       6183  2020-03-27 11:21  springmvc_2020\build\classes\controller\UserController.class

     文件       1505  2020-03-28 10:11  springmvc_2020\build\classes\dao\baseDao.class

     文件        700  2020-03-27 09:30  springmvc_2020\build\classes\dao\MessageDao.class

     文件       1546  2020-03-28 10:02  springmvc_2020\build\classes\dao\MessageMapper.xml

     文件        596  2020-03-28 09:53  springmvc_2020\build\classes\dao\UserDao.class

     文件       1425  2020-03-28 10:05  springmvc_2020\build\classes\dao\UserMapper.xml

     文件       1559  2020-03-25 15:10  springmvc_2020\build\classes\entity\Message.class

     文件       1276  2020-03-26 09:59  springmvc_2020\build\classes\entity\MessageVo.class

     文件       1625  2020-03-28 09:47  springmvc_2020\build\classes\entity\User.class

     文件        841  2020-03-28 10:21  springmvc_2020\build\classes\mybatis-config.xml

     文件       4230  2020-03-28 10:11  springmvc_2020\build\classes\service\impl\MessageServiceImpl.class

     文件       1998  2020-03-28 10:11  springmvc_2020\build\classes\service\impl\UserServiceImpl.class

     文件        591  2020-03-27 09:28  springmvc_2020\build\classes\service\MessageService.class

     文件        469  2020-03-25 11:18  springmvc_2020\build\classes\service\UserService.class

     文件       1025  2020-03-25 08:31  springmvc_2020\build\classes\springmvc.xml

     文件       2158  2020-03-27 10:10  springmvc_2020\src\controller\MessageController.java

     文件       4330  2020-03-27 11:21  springmvc_2020\src\controller\UserController.java

     文件       1094  2020-03-28 10:11  springmvc_2020\src\dao\baseDao.java

     文件        491  2020-03-27 09:30  springmvc_2020\src\dao\MessageDao.java

     文件       1546  2020-03-28 10:02  springmvc_2020\src\dao\MessageMapper.xml

     文件        547  2020-03-28 09:53  springmvc_2020\src\dao\UserDao.java

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

评论

共有 条评论