package com.liuyp.ssm.action;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;
import com.liuyp.ssm.entities.Employee;
import com.liuyp.ssm.mapper.EmployeeMapper;
@Controller
@RequestMapping("/ok")
@SessionAttributes({"msg1","msg2"})
public class OkController{
@Resource
private EmployeeMapper empMapper;
@RequestMapping(params="method=ok1")
public String okAction1(@RequestParam("uname") String uname, ModelMap map){
map.put("msg1", uname);
System.out.println(uname);
return "ok1";
}
@RequestMapping(params="method=ok2")
public ModelAndView okAction2(@ModelAttribute("msg1") String uname, ModelMap map){
map.put("msg2", uname);
ModelAndView mav = new ModelAndView("ok2");
return mav;
}
@RequestMapping("/ok3.action")
public ModelAndView okAction3(@ModelAttribute("msg1") String uname, ModelMap map){
map.put("msg2", uname);
ModelAndView mav = new ModelAndView("ok2");
return mav;
}
@RequestMapping("/ok4.action")
public ModelAndView okAction4(ModelMap map) throws Exception{
List<Employee> emps = empMapper.selectAll();
Employee empByID = empMapper.selectAllByID(1);
List<Employee> empByName = empMapper.selectAllByName("D' or 1=1 or email like '");// sql注入
String fEmail = empMapper.selectColumnByID(2);
System.out.println("emps = " + emps.toString());
System.out.println("empByID = " + empByID);
System.out.println("empByName = " + empByName.toString());
System.out.println("fEmail = " + fEmail);
map.put("msg2", emps);
ModelAndView mav = new ModelAndView("ok2");
return mav;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
spring+springMVC+myBatis整合
共69个文件
jar:37个
xml:10个
properties:4个
4星 · 超过85%的资源 需积分: 3 8 下载量 172 浏览量
2016-11-28
20:11:46
上传
评论
收藏 28.18MB ZIP 举报
温馨提示
spring+springMVC+myBatis非maven环境的整合实例。
资源推荐
资源详情
资源评论
收起资源包目录
SSM(springMVC_spring_myBatis).zip (69个子文件)
SSM(springMVC_spring_myBatis)
.project 1KB
.tern-project 131B
.settings
.jsdtscope 500B
org.eclipse.wst.common.component 608B
org.eclipse.jdt.core.prefs 364B
org.eclipse.wst.common.project.facet.core.xml 345B
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.jsdt.ui.superType.name 6B
conf
log4j.properties 2KB
sqlMapConfig.xml 507B
springMVC-servlet.xml 1KB
db.properties 383B
applicationContext.xml 4KB
WebRoot
WEB-INF
web.xml 1KB
jsp
ok1.jsp 373B
ok2.jsp 373B
lib
slf4j-log4j12-1.7.12.jar 9KB
mysql-connector-java-5.1.26-bin.jar 836KB
commons-pool-1.3.jar 61KB
spring-core-4.0.0.RELEASE.jar 933KB
jstl-1.2.jar 405KB
spring-aspects-4.0.0.RELEASE.jar 50KB
spring-beans-4.0.0.RELEASE.jar 654KB
com.springsource.net.sf.cglib-2.2.0.jar 319KB
spring-tx-4.0.0.RELEASE.jar 242KB
javassist-3.17.1-GA.jar 695KB
aspectj-1.7.1.jar 13.17MB
asm-4.2.jar 47KB
spring-aop-4.0.0.RELEASE.jar 343KB
c3p0-0.9.1.2-jdk1.3.jar 595KB
commons-logging-1.2.jar 60KB
com.springsource.org.aopalliance-1.0.0.jar 5KB
log4j-1.2.17.jar 478KB
aspectjweaver-1.7.1.jar 1.71MB
mybatis-spring-1.2.2.jar 48KB
log4j-api-2.2.jar 130KB
spring-context-4.0.0.RELEASE.jar 928KB
spring-orm-4.0.0.RELEASE.jar 309KB
spring-jdbc-4.0.0.RELEASE.jar 410KB
ehcache-core-2.6.5.jar 1.28MB
cglib-3.1.jar 276KB
c3p0-0.9.1.2.jar 596KB
commons-dbcp-1.2.2.jar 119KB
log4j-core-2.2.jar 807KB
mybatis-ehcache-1.0.2.jar 10KB
mybatis-3.3.0.jar 1.35MB
c3p0-oracle-thin-extras-0.9.1.2.jar 3KB
spring-web-4.0.0.RELEASE.jar 646KB
aopalliance-1.0.jar 4KB
slf4j-api-1.7.12.jar 31KB
com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar 1.57MB
spring-expression-4.0.0.RELEASE.jar 202KB
spring-webmvc-4.0.0.RELEASE.jar 645KB
index.jsp 531B
META-INF
MANIFEST.MF 39B
src
com
liuyp
ssm
utils
action
OkController.java 2KB
entities
Employee.java 1KB
mapper
EmployeeMapper.xml 1KB
EmployeeMapper.java 714B
service
build
classes
log4j.properties 2KB
sqlMapConfig.xml 507B
springMVC-servlet.xml 1KB
com
liuyp
ssm
utils
action
OkController.class 3KB
entities
Employee.class 2KB
mapper
EmployeeMapper.xml 1KB
EmployeeMapper.class 938B
service
db.properties 383B
applicationContext.xml 4KB
.classpath 4KB
共 69 条
- 1
资源评论
- qq_274213152016-11-30谢谢分享,去学习一下
lypalone
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Unity XR 手势射击控制脚本(适用于任何可手势识别的设备)
- 机械设计全自动电表(NB和IC卡表)控制和上壳装配线sw16可编辑非常好的设计图纸100%好用.zip
- 基于matlab的EAN-13条形码识别系统GUI界面.zip代码53
- matlab基于bp神经网络交通信号标志识别GUI界面13个标志.zip代码54
- 电子万年历答辩实物展示视频mp4格式
- 基于python实现的程序,包括哈希感知算法cvHash,图像切割cvsplit,固定目标检测cvRec(附文档ppt)等
- 计算0-10000之间所有偶数的和
- multiled.zip
- 基于php实现的哈希算法的人脸检索
- 单片机 电子钟 设计报告/课程设计
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功