没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Spring Boot 2.5.0
SSM环境搭建
spring
springmvc
mybatis
spring springmvc mybatis 简单功能 员⼯添加 查询 所有
引⼊依赖
# # 项⽬项⽬
- !需求分析 概要设计(库表设计) ! 详细设计(验证库表正确性) 编码(环境搭建+业务代码)
测试 部署上线
# # 员⼯添加员⼯添加 查询所有功能查询所有功能 SSM SSM
- 库表 ! 库: ssm ! 数据库:mysql 表: id name birthday salary
# # 编码编码 环境搭建环境搭建 ssm spring springmvc ! ssm spring springmvc ! ⼀个团队开发⼀个团队开发 ⽆缝整合⽆缝整合
- springmvc spring mybatis
<dependencies>
! ! ! !<!--junit-->
! ! ! !<dependency>
! ! ! ! ! !<groupId>junit</groupId>
! ! ! ! ! !<artifactId>junit</artifactId>
! ! ! ! ! !<version>4.11</version>
! ! ! ! ! !<scope>test</scope>
! ! ! !</dependency>
! ! ! !<!--spring-->
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.springframework</groupId>
! ! ! ! ! !<artifactId>spring-core</artifactId>
! ! ! ! ! !<version>5.3.6</version>
! ! ! !</dependency>
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.springframework</groupId>
! ! ! ! ! !<artifactId>spring-beans</artifactId>
! ! ! ! ! !<version>5.3.6</version>
! ! ! !</dependency>
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.springframework</groupId>
! ! ! ! ! !<artifactId>spring-aop</artifactId>
! ! ! ! ! !<version>5.3.6</version>
! ! ! !</dependency>
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.springframework</groupId>
! ! ! ! ! !<artifactId>spring-context</artifactId>
! ! ! ! ! !<version>5.3.6</version>
! ! ! !</dependency>
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.springframework</groupId>
! ! ! ! ! !<artifactId>spring-context-support</artifactId>
! ! ! ! ! !<version>5.3.6</version>
! ! ! !</dependency>
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.springframework</groupId>
! ! ! ! ! !<artifactId>spring-jdbc</artifactId>
! ! ! ! ! !<version>5.3.6</version>
! ! ! !</dependency>
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.springframework</groupId>
! ! ! ! ! !<artifactId>spring-web</artifactId>
! ! ! ! ! !<version>5.3.6</version>
! ! ! !</dependency>
! ! ! !<!--spring web mvc-->
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.springframework</groupId>
! ! ! ! ! !<artifactId>spring-webmvc</artifactId>
! ! ! ! ! !<version>5.3.6</version>
! ! ! !</dependency>
! ! ! !<!--druid-->
! ! ! !<dependency>
! ! ! ! ! !<groupId>com.alibaba</groupId>
! ! ! ! ! !<artifactId>druid</artifactId>
! ! ! ! ! !<version>1.2.4</version>
! ! ! !</dependency>
! ! ! !<!--mysql-->
! ! ! !<dependency>
! ! ! ! ! !<groupId>mysql</groupId>
! ! ! ! ! !<artifactId>mysql-connector-java</artifactId>
! ! ! ! ! !<version>5.1.38</version>
! ! ! !</dependency>
! ! ! !<!--mybatis-->
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.mybatis</groupId>
! ! ! ! ! !<artifactId>mybatis</artifactId>
! ! ! ! ! !<version>3.5.6</version>
! ! ! !</dependency>
! ! ! !<dependency>
创建spring配置
! ! ! ! ! !<groupId>org.mybatis</groupId>
! ! ! ! ! !<artifactId>mybatis-spring</artifactId>
! ! ! ! ! !<version>2.0.6</version>
! ! ! !</dependency>
! ! ! !<!-- jackson-->
! ! ! !<dependency>
! ! ! ! ! !<groupId>com.fasterxml.jackson.core</groupId>
! ! ! ! ! !<artifactId>jackson-databind</artifactId>
! ! ! ! ! !<version>2.9.3</version>
! ! ! !</dependency>
! ! ! !<!-- aspectj -->
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.aspectj</groupId>
! ! ! ! ! !<artifactId>aspectjweaver</artifactId>
! ! ! ! ! !<version>1.9.5</version>
! ! ! !</dependency>
! ! ! !<!--aspectj-->
! ! ! !<dependency>
! ! ! ! ! !<groupId>org.aspectj</groupId>
! ! ! ! ! !<artifactId>aspectjrt</artifactId>
! ! ! ! ! !<version>1.9.5</version>
! ! ! !</dependency>
! !</dependencies>
<!--开启注解扫描-->
<context:component-scan base-package="com.baizhi.service">
!<context:exclude-filter type="aspectj"
expression="com.baizhi.controller..*"/>
</context:component-scan>
<!-- 创建DataSource-->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
!<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
!<property name="url" value="jdbc:mysql://localhost:3306/ssm?
characterEncoding=UTF-8"/>
!<property name="username" value="root"/>
!<property name="password" value="root"/>
</bean>
<!-- 创建 SQLSessionFactoryBean -->
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
!<property name="dataSource" ref="dataSource"/>
!<property name="mapperLocations"
value="classpath:com/baizhi/mapper/*.xml"/>
!<property name="typeAliasesPackage" value="com.baizhi.entity"/>
</bean>
<!-- 创建dao -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
!<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
!<property name="basePackage" value="com.baizhi.dao"/>
</bean>
<!-- 创建事务管理器-->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
>
!<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 开启注解事务⽣效-->
<tx:annotation-driven transaction-manager="transactionManager"/>
剩余58页未读,继续阅读
资源评论
106号水手
- 粉丝: 18
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功