首页>代码>基于SSM框架的B/S项目开发—学校班级回忆录网站管理系统>/ClassManage/src/com/demo/controller/MainController.java
package com.demo.controller;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.demo.entity.Student;
import com.demo.services.IStudentService;

@Controller
@Scope("prototype")
@RequestMapping("/main.do")
public class MainController {
	@Autowired
	private IStudentService service;
	
	@RequestMapping(params = "action=login_information")
	public ModelAndView login_information(HttpServletRequest request,ModelMap map,Student student,int login_id) throws IOException{
		student=service.findStudentById(login_id);
		map.put("student", student);
		return new ModelAndView("login_information");
	}
	
	@RequestMapping(params = "action=addressBook")
	public ModelAndView addressBook(HttpServletRequest request,ModelMap map,int login_id) throws IOException{
		 ArrayList<Student> studentLists = service.findAllStudent();  
		 map.put("studentList", studentLists);  
		 int manager=service.findStudentById(login_id).getManager();
		 map.put("manager", manager);
		 map.put("login_id", login_id);
	     return new ModelAndView("addressBook");  
	}
	
	@RequestMapping(params = "action=modify_password")
	public ModelAndView modify_password(HttpServletRequest request,ModelMap map,int login_id) throws IOException{
		map.put("login_id", login_id);
		return new ModelAndView("modify_password");
	}

}
最近下载更多
hjjhhhh  LV4 2023年2月28日
asd521531  LV9 2022年12月14日
lilong007  LV20 2022年10月21日
akbar2020  LV9 2022年8月27日
34385135  LV2 2022年4月19日
找找找找找  LV4 2022年3月17日
qlpqlp  LV7 2022年3月13日
wanglinddad  LV54 2022年2月17日
曹思辰  LV6 2022年1月17日
Lin一点  LV4 2021年12月30日
最近浏览更多
WBelong  LV7 2023年12月27日
钝感力  LV1 2023年10月28日
iloveyou66  LV2 2023年9月3日
cunbie  LV4 2023年6月13日
yangbulx  LV3 2023年6月7日
6389181  LV7 2023年6月1日
一口深井  LV1 2023年5月23日
苏拉德666  LV4 2023年5月15日
可是不知道么  LV23 2023年3月25日
hjjhhhh  LV4 2023年2月28日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友