package cn.itcast.ssm.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import cn.itcast.ssm.po.Peoples;
import cn.itcast.ssm.po.User;
import cn.itcast.ssm.service.ItemsService;
@Controller
public class PeoplesController {
@Autowired
private ItemsService itemsService;
@RequestMapping(value="/peoples.do",method={RequestMethod.POST,RequestMethod.GET})
public ModelAndView queryPeoples(HttpServletRequest request) throws Exception {
List<Peoples> peoplesList = itemsService.findPeoplesList(null);
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("peoplesList", peoplesList);
modelAndView.setViewName("users/PeopleMangement");
return modelAndView;
}
@RequestMapping("/addpeoples.do")
public String addpeoples(Peoples peoples) throws Exception {
itemsService.add(peoples);
return "redirect:/peoples.do";
}
@RequestMapping("/deletepeoples.do")
public String delete( Model model,@RequestParam(value="id",required=true) Integer id)throws Exception{
System.out.println("这是获取到的id"+id);
itemsService.delete(id);
return "redirect:/peoples.do";
}
@RequestMapping("/updatepeople.do")
public String updatepeoples(Peoples peoples)throws Exception{
itemsService.updatepeoplebyid(peoples);
return "redirect:/peoples.do";
}
@RequestMapping("/updatepeoples.do")
public String update( Model model,@RequestParam(value="id",required=true) Integer id)throws Exception{
System.out.println("这是获取到的id"+id);
Peoples people = itemsService.findpeopleById(id);
//通过形参中的model将model数据传到页面
//相当于modelAndView.addObject方法
model.addAttribute("peoplesList", people);
return "users/UpdatePeoples";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
基于springMVC+mybatis框架的旅游特产管理
共240个文件
jar:50个
xml:26个
jpg:24个
需积分: 9 11 下载量 17 浏览量
2017-04-01
17:30:07
上传
评论 1
收藏 15.98MB ZIP 举报
温馨提示
基于springmvc和mybatis框架的旅游特产管理,使用mySQL数据库进行数据存储。外观样式使用了bootstrap技术。上传人为北京邮电大学世纪学院2013级学生qmy。 请使用使用eclipse打开。 环境要求:jdk1.8、tomcat7.0及以上版本。
资源推荐
资源详情
资源评论
收起资源包目录
基于springMVC+mybatis框架的旅游特产管理 (240个子文件)
assumedExternalFilesCache 4B
fb.png.bak 408B
PeoplesController.class 3KB
LoginController.class 3KB
ItemsServiceImpl.class 2KB
Peoples.class 1KB
User.class 1KB
UserMapper.class 1015B
RegisterController.class 981B
ItemsService.class 740B
PeoplesMapper.class 491B
.classpath 5KB
org.eclipse.wst.common.component 610B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootstrap.css 143KB
bootstrap.min.css 118KB
bootstrap-theme.css 26KB
bootstrap-theme.min.css 23KB
login.css 4KB
index.css 4KB
variablesAndContainers.dat 129B
glyphicons-halflings-regular.eot 20KB
externalFilesCache 4B
user_top_c.gif 7KB
user_botton.gif 6KB
user_top_l.gif 6KB
user_bottom_c.gif 6KB
user_bottom_r.gif 4KB
user_bottom_l.gif 4KB
user_top_r.gif 4KB
user_main_l.gif 3KB
user_main_r.gif 3KB
user_main_c.gif 2KB
user_login_name.gif 2KB
user_login_re.gif 1KB
user_login_password.gif 1KB
user_all_bg.gif 811B
properties.index 151B
version.ini 102B
invalidArchivesCache 4B
aspectjweaver-1.6.11.jar 1.61MB
spring-context-4.3.4.RELEASE.jar 1.08MB
spring-core-4.3.4.RELEASE.jar 1.06MB
spring-webmvc-4.3.4.RELEASE.jar 892KB
spring-web-4.3.4.RELEASE.jar 795KB
spring-beans-4.3.4.RELEASE.jar 743KB
mybatis-3.2.7.jar 696KB
javassist-3.17.1-GA.jar 695KB
mysql-connector-java-5.1.7-bin.jar 693KB
log4j-core-2.0-rc1.jar 686KB
spring-test-4.3.4.RELEASE.jar 582KB
log4j-1.2.17.jar 478KB
spring-orm-4.3.4.RELEASE.jar 466KB
spring-websocket-4.3.4.RELEASE.jar 440KB
spring-jdbc-4.3.4.RELEASE.jar 417KB
jstl-1.2.jar 405KB
spring-security-config-3.2.5.RELEASE.jar 397KB
spring-messaging-4.3.4.RELEASE.jar 372KB
spring-aop-4.3.4.RELEASE.jar 371KB
spring-security-core-3.2.5.RELEASE.jar 358KB
spring-security-web-3.2.5.RELEASE.jar 334KB
spring-jms-4.3.4.RELEASE.jar 282KB
cglib-2.2.2.jar 280KB
spring-tx-4.3.4.RELEASE.jar 261KB
spring-expression-4.3.4.RELEASE.jar 257KB
junit-4.9.jar 243KB
spring-context-support-4.3.4.RELEASE.jar 183KB
spring-webmvc-portlet-4.3.4.RELEASE.jar 173KB
commons-dbcp-1.2.2.jar 119KB
log4j-api-2.0-rc1.jar 113KB
servlet-api-2.5.jar 103KB
spring-security-ldap-3.2.5.RELEASE.jar 97KB
spring-oxm-4.3.4.RELEASE.jar 83KB
spring-security-acl-3.2.5.RELEASE.jar 81KB
commons-pool-1.3.jar 61KB
commons-logging-1.1.1.jar 59KB
spring-aspects-4.3.4.RELEASE.jar 57KB
mybatis-spring-1.2.2.jar 48KB
asm-3.3.1.jar 43KB
spring-security-crypto-3.2.5.RELEASE.jar 41KB
spring-security-cas-3.2.5.RELEASE.jar 26KB
slf4j-api-1.7.5.jar 25KB
spring-security-taglibs-3.2.5.RELEASE.jar 24KB
spring-security-openid-3.2.5.RELEASE.jar 19KB
spring-security-remoting-3.2.5.RELEASE.jar 11KB
spring-instrument-tomcat-4.3.4.RELEASE.jar 10KB
slf4j-log4j12-1.7.5.jar 9KB
spring-instrument-4.3.4.RELEASE.jar 7KB
spring-security-aspects-3.2.5.RELEASE.jar 6KB
aopalliance-1.0.jar 4KB
PeoplesController.java 2KB
ItemsServiceImpl.java 2KB
LoginController.java 2KB
User.java 962B
Peoples.java 892B
UserMapper.java 855B
RegisterController.java 612B
ItemsService.java 602B
PeoplesMapper.java 335B
bg.jpg 253KB
共 240 条
- 1
- 2
- 3
资源评论
小郄同学
- 粉丝: 35
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功