package cn.springmvc.test;
import java.awt.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import cn.springmvc.model.User;
import cn.springmvc.service.UserService;
/**
* 对于springMVC+Spring3+mybatise+maven框架不熟悉的,可以加QQ:5101437探讨交流。
* 另外帮做大四计算机专业毕业设计.各种JSP网站 ASP,安卓方面的
* 或者刚入职不久,对javaEE开发不是很熟,感觉工作压力较大的也可以加QQ5101437探讨交流
* @author QQ:5101437
*
*/
public class UserTest {
private UserService userService;
@Before
public void before(){
ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"classpath:conf/spring.xml"
,"classpath:conf/spring-mybatis.xml"});
userService = (UserService) context.getBean("userServiceImpl");
}
@Test
public void addUser(){
User user = new User();
user.setId(3);
user.setNickname("你好");
user.setState(2);
userService.insertUser(user);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ssm.rar (40个子文件)
mydays.sql 750B
ssm
.project 1KB
src
test
resources
java
cn
springmvc
test
UserTest.java 1KB
main
webapp
WEB-INF
lib
web.xml 3KB
index.jsp 728B
META-INF
MANIFEST.MF 39B
resources
conf
spring-mybatis.xml 3KB
spring-mvc.xml 1KB
jdbc.properties 204B
mybatis-config.xml 431B
log4j.properties 1KB
spring.xml 801B
mapper
UserMapper.xml 526B
java
cn
springmvc
service
impl
UserServiceImpl.java 811B
UserService.java 441B
model
User.java 557B
controller
UserController.java 583B
dao
UserDAO.java 501B
target
classes
conf
spring-mybatis.xml 3KB
spring-mvc.xml 1KB
jdbc.properties 204B
mybatis-config.xml 431B
log4j.properties 1KB
spring.xml 801B
cn
springmvc
service
UserService.class 176B
impl
UserServiceImpl.class 769B
model
User.class 915B
controller
UserController.class 597B
dao
UserDAO.class 164B
mapper
UserMapper.xml 526B
test-classes
cn
springmvc
test
UserTest.class 1KB
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.common.project.facet.core.xml 252B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 430B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.component 739B
.jsdtscope 508B
pom.xml 5KB
.classpath 2KB
共 40 条
- 1
「已注销」
- 粉丝: 5
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页