资源简介
spring+springmvc+mybastis+mysql的学生成绩管理页面,可实现学生信息和成绩的增删查改
代码片段和文件信息
package com.zhouxiaobo.mvc.controller;
import com.zhouxiaobo.mvc.model.Exam;
import com.zhouxiaobo.mvc.model.Student;
import com.zhouxiaobo.mvc.model.StudentScore;
import com.zhouxiaobo.mvc.model.Subject;
import com.zhouxiaobo.mvc.model.page.StudentScorePage;
import com.zhouxiaobo.mvc.pagination.Page;
import com.zhouxiaobo.mvc.service.StudentScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping(“/“)
public class ScoreController {
@Autowired
protected StudentScoreService studentScoreService;
private void initdrowdown(Model model){
List subjects = studentScoreService.listAllSubject();
List students = studentScoreService.listAllStudent();
List exams = studentScoreService.listAllExam();
model.addAttribute(“dropdownSubject“ subjects);
model.addAttribute(“dropdownStudent“ students);
model.addAttribute(“dropdownExam“ exams);
}
@RequestMapping(method = RequestMethod.GET)
public String printWelcome(Model model) {
initdrowdown(model);
return “scores“;
}
@RequestMapping(value = “/rest/getStudent/{id}“ method = RequestMethod.POST)
@ResponseBody
public Student getStudent(@PathVariable String id){
Student st = studentScoreService.getStudent(Integer.parseInt(id));
return st;
}
@RequestMapping(value = “/rest/updateScore“ method = RequestMethod.POST)
@ResponseBody
public Map updateScore(@RequestBody StudentScore studentScore){
Map result = new HashMap();
try{
studentScoreService.updateScore(studentScore);
result.put(“flag““success“);
}catch(Exception e){
result.put(“flag““fail“);
}
return result;
}
@RequestMapping(value = “/listscore“ method = RequestMethod.POST)
public String queryStudent(Model model@ModelAttribute StudentScorePage studentScorePage){
initdrowdown(model);
List scores = studentScoreService.listStudentScore(studentScorePage);
model.addAttribute(“scores“scores);
model.addAttribute(“queryCondition“studentScorePage);
return “scores“;
}
@RequestMapping(value = “/delscore/{delId}“)
public String delScore(Model model@PathVariable String delId@ModelAttribute StudentScorePage studentScorePage){
studentScoreService.deleteScore(Integer.parseInt(delId));
queryStudent(model studentScorePage);
return “scores“;
}
@RequestMapping(value = “/insertscore“method = RequestMethod.POST)
public String insertScore(Model model@ModelAttribute StudentScore insertScore){
studentScoreService.insertScore(insertScore);
StudentScorePage studentScorePage = new StudentScorePage();
if(insertScore != null && insertScore.getStudent() != null){
Student st = studentScoreService.getStudent(insertScore.getStudent
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6148 2015-09-09 21:52 scoredemo\trunk\.DS_Store
文件 6 2015-11-27 09:53 scoredemo\trunk\.idea\.name
文件 277 2015-11-27 09:53 scoredemo\trunk\.idea\artifacts\mydemo_war.xm
文件 4330 2015-11-27 09:53 scoredemo\trunk\.idea\artifacts\mydemo_war_exploded.xm
文件 1174 2015-11-27 09:53 scoredemo\trunk\.idea\compiler.xm
文件 74 2015-11-27 09:53 scoredemo\trunk\.idea\copyright\profiles_settings.xm
文件 502 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__aopalliance_aopalliance_1_0.xm
文件 556 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__ch_qos_logback_logback_classic_1_1_1.xm
文件 535 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__ch_qos_logback_logback_core_1_1_1.xm
文件 560 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__commons_logging_commons_logging_1_1_3.xm
文件 632 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__com_fasterxm
文件 583 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__com_fasterxm
文件 611 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__com_fasterxm
文件 724 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__com_fasterxm
文件 529 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__com_googlecode_log4jdbc_log4jdbc_1_2.xm
文件 503 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__com_google_code_gson_gson_2_3_1.xm
文件 566 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__javax_servlet_javax_servlet_api_3_0_1.xm
文件 461 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__javax_servlet_jstl_1_2.xm
文件 443 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__junit_junit_4_11.xm
文件 562 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__mysql_mysql_connector_java_5_1_20.xm
文件 499 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__opensymphony_sitemesh_2_4_2.xm
文件 558 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_apache_commons_commons_lang3_3_2_1.xm
文件 547 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_apache_tomcat_tomcat_jdbc_7_0_52.xm
文件 547 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_apache_tomcat_tomcat_juli_7_0_52.xm
文件 502 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_aspectj_aspectjrt_1_7_4.xm
文件 530 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_aspectj_aspectjweaver_1_7_4.xm
文件 587 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_codehaus_jackson_jackson_core_asl_1_9_4.xm
文件 601 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_codehaus_jackson_jackson_mapper_asl_1_9_4.xm
文件 520 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_hamcrest_hamcrest_core_1_3.xm
文件 488 2015-11-27 09:53 scoredemo\trunk\.idea\libraries\Maven__org_mybatis_mybatis_3_2_8.xm
............此处省略138个文件信息
相关资源
- Maven搭建Spring+Mybatis+MySql
- 最新_尚硅谷_mybatisplus_全套视频教程
- myBatis中文文档
- springmvc+spring+mybatis+mysql数据库整合读
- 框架写的简单学生管理系统
- 毕业设计体检预约系统-springmvc+mybat
- mybatis 整合oracle (含增删改查)
- Struts2+spring+Mybatis+mysql+架包相对完善的
- Ajax+SpringMVC+Spring+Mybatis+MySql+js用户注册
- 基于springmvc、spring、mybatis、shiro、e
- SpingMVC+MyBatis简单权限管理系统
- Extjs+Mysql+SpringMVC+MyBatis通用后台管理系
- idea+springboot+oracle+mybatis
- SpringMVC+Mybatis+SQLServer整合源码 含数据
- SSM框架--Spring+SpringMVC+Mybatis整合
- spring+springmvc+mybatis OA考勤管理系统带
- MyBatis的逆向工程——generatorSqlmapCus
- 基于SSM框架的完整项目 Spring+SpringMV
- SSM框架+mybatis自动生成代码
- 家庭财务管理系统SpringMVC3+Spring3+Myb
- spring+Mybatis+SpringMVC资源整合增删改查
- maven+springMVC+mybatis+mysql+Bootstrap-Admin-
- 基于springmvc+mybatis+spring+maven+mysql的网
- spring+springmvc+mybatis完善的增删改查,
- MyBatis通过 JDBC连接 SQL server 数据库简
- MyBatis通过 JDBC连接 PostgreSQL数据库 最
- spring-boot集成mybtis+druid实现hive/mysql多
- 网上书店SSM+Bootstrap+Mysql
- ssm后台管理系统框架(Spring mvc + myb
- ssm后台管理系统框架(Spring mvc + myb
评论
共有 条评论