package com.se.controller;
import javax.annotation.Resource;
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 com.se.pojo.User;
import com.se.service.IUserService;
@Controller
@RequestMapping("/user")
public class UserController {
@Resource
private IUserService userService;
public IUserService getUserService() {
return userService;
}
@Autowired
public void setUserService(IUserService userService) {
this.userService = userService;
}
@RequestMapping("/showUser")
public String toIndex(HttpServletRequest request, Model model) {
int userId = Integer.parseInt(request.getParameter("id"));
System.out.println(userId + "------------------------");
User user = this.userService.getUserById(userId);
model.addAttribute("user", user);
return "index2";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Spring4+SpringMVC+Mybatis3框架整合
共49个文件
xml:12个
java:6个
class:6个
需积分: 10 9 下载量 26 浏览量
2017-09-02
01:06:15
上传
评论
收藏 41KB ZIP 举报
温馨提示
实现Spring同MVC和Mybatis的整合,通过这个demo可以搭建一个项目框架,逐步完善业务需要,从而节省开发时间。
资源推荐
资源详情
资源评论
收起资源包目录
Seven(Spring+SpringMVC+MybatisMaven).zip (49个子文件)
seven
.project 1KB
pom.xml 6KB
target
generated-test-sources
test-annotations
test-classes
sy
test
TestMybatis.class 2KB
maven-archiver
pom.properties 118B
maven-status
maven-compiler-plugin
compile
default-compile
createdFiles.lst 165B
inputFiles.lst 395B
testCompile
default-testCompile
createdFiles.lst 26B
inputFiles.lst 72B
generated-sources
annotations
classes
spring-mybatis.xml 3KB
log4j.properties 1KB
com
se
dao
IUserDao.class 367B
mapping
UserMapper.xml 3KB
controller
UserController.class 2KB
service
IUserService.class 184B
impl
IUserServiceImpl.class 772B
pojo
User.class 1KB
spring-mvc.xml 2KB
jdbc.properties 483B
spring-config.xml 687B
.settings
org.eclipse.wst.common.project.facet.core.xml.bak 252B
org.eclipse.wst.common.project.facet.core.prefs.xml 321B
org.eclipse.wst.ws.service.policy.prefs 87B
.jsdtscope 639B
org.eclipse.wst.common.component 656B
org.eclipse.wst.validation.prefs 50B
org.eclipse.jdt.core.prefs 736B
org.eclipse.wst.common.project.facet.core.xml 346B
org.eclipse.ltk.core.refactoring.prefs 106B
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.m2e.core.prefs 90B
org.eclipse.wst.jsdt.ui.superType.name 6B
src
test
java
sy
test
TestMybatis.java 931B
main
resources
spring-mybatis.xml 3KB
log4j.properties 1KB
spring-mvc.xml 2KB
jdbc.properties 483B
spring-config.xml 687B
java
com
se
dao
IUserDao.java 336B
mapping
UserMapper.xml 3KB
controller
UserController.java 1KB
service
IUserService.java 136B
impl
IUserServiceImpl.java 450B
pojo
User.java 745B
webapp
WEB-INF
web.xml 2KB
jsp
index3.jsp 89B
index2.jsp 300B
index.jsp 63B
.classpath 1KB
logs
ssm.log 166KB
共 49 条
- 1
资源评论
TSINGTAO_Y
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功