1.ssm框架需要的jar包
链接:https://pan.baidu.com/s/1iErZoHZmKBPhAIm5lqFbVQ
提取码:4ssj
SSM
包括六层架构
1 controller层
2 dao层
3 model层
4 service层
5 service.impl层
6 mapper层
其中用到mvc注解的有controller层和serviceImpl层
首先controller层需要注解 @controller
然后表单对应的层 @RequestMapping("/user")
然后controller类对应的方法也要加对应的@RequestMapping("/方法名")
引用某层的,必须注解加@Resource
而 ServiceImpl层类前面先加上@Service("/父接口") ;引入哪层必须加@Resource
2 配置文件 四个配置文件
2.1 applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.sprin