package csc.hfz.Controller;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import csc.hfz.Model.Student;
import csc.hfz.Service.UserService;
/**
*@author hongfz
*
**/
@Controller
public class UserController {
@Autowired
private UserService userService;
private static final Log logger=
LogFactory.getLog(UserController.class);
/*
*对应页面
*
*/
@RequestMapping(value="/user_list")
public String showAll(Model model){
logger.info("user_list");
List<Student> student=userService.findAll();
model.addAttribute("Student",student);
return "UserList";
}
@RequestMapping(value="/user_edit/{id}")
public String findById(Model model,@PathVariable int id){
Student student=userService.findById(id);
model.addAttribute("Student",student);
return "UserEdit";
}
@RequestMapping(value="/user_delete/{id}")
public String delete(Model model,@PathVariable int id){
userService.delete(id);
return "redirct:/user_list";
}
@RequestMapping(value="/user_update")
public String update(@ModelAttribute Student student){
userService.update(student);
return "redirect:/user_list";
}
@RequestMapping(value="/add_User")
public String AddStu(Model model){
model.addAttribute("Student",new Student());
return "AddUser";
}
@RequestMapping(value="/user_save")
public String StuSave(@ModelAttribute Student student){
userService.save(student);
return "redirect:/user_list";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
简单实现SSM增删改查
共61个文件
jar:25个
xml:12个
class:5个
4星 · 超过85%的资源 需积分: 14 64 下载量 146 浏览量
2017-02-06
15:25:39
上传
评论
收藏 26.11MB ZIP 举报
温馨提示
实现最基本的增删改查,利用spring+springmvc+mybatis
资源推荐
资源详情
资源评论
收起资源包目录
UManager.zip (61个子文件)
UManager
.project 1KB
src
log4j.xml 641B
spring-config.xml 3KB
mybatis-cfg.xml 477B
springmvc.xml 1KB
db.properties 195B
csc
hfz
Mapper
UserMapper.java 286B
UserMapper.xml 939B
ServiceImpl
UserServiceImpl.java 881B
Controller
UserController.java 2KB
Service
UserService.java 349B
Model
Student.java 804B
WebRoot
WEB-INF
jsp
UserList.jsp 1KB
AddUser.jsp 1KB
UserEdit.jsp 1001B
classes
log4j.xml 641B
spring-config.xml 3KB
mybatis-cfg.xml 477B
springmvc.xml 1KB
db.properties 195B
csc
hfz
Mapper
UserMapper.class 383B
UserMapper.xml 939B
ServiceImpl
UserServiceImpl.class 1KB
Controller
UserController.class 3KB
Service
UserService.class 469B
Model
Student.class 1KB
lib
spring-context-4.2.4.RELEASE.jar 1.05MB
commons-dbcp-1.2.2.jar 119KB
spring-test-4.2.4.RELEASE.jar 549KB
mybatis-spring-1.2.2.jar 48KB
aspectj-1.7.1.jar 13.17MB
commons-pool-1.3.jar 61KB
spring-jdbc-4.2.4.RELEASE.jar 413KB
jstl-1.2.jar 405KB
mybatis-ehcache-1.0.2.jar 10KB
ojdbc6.jar 1.9MB
standard-1.1.2.jar 384KB
spring-orm-4.2.4.RELEASE.jar 455KB
spring-core-4.2.4.RELEASE.jar 1.03MB
spring-beans-4.2.4.RELEASE.jar 714KB
spring-aop-4.2.4.RELEASE.jar 361KB
log4j-1.2.17.jar 478KB
mybatis-3.3.0.jar 1.35MB
spring-tx-4.2.4.RELEASE.jar 259KB
ehcache-core-2.6.5.jar 1.28MB
spring-webmvc-4.2.4.RELEASE.jar 854KB
aopalliance-1.0.jar 4KB
commons-logging-1.2.jar 60KB
spring-expression-4.2.4.RELEASE.jar 257KB
aspectjweaver-1.7.1.jar 1.71MB
spring-web-4.2.4.RELEASE.jar 749KB
web.xml 2KB
index.jsp 834B
META-INF
MANIFEST.MF 39B
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.common.project.facet.core.xml 414B
org.eclipse.jdt.core.prefs 364B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.component 483B
.jsdtscope 522B
.classpath 737B
共 61 条
- 1
资源评论
- icefoxd2017-06-03下载之后改了数据库配置文件,还是不能运行
好给定性
- 粉丝: 16
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功