当前位置:网站首页>将Servlet项目改为SSM项目
将Servlet项目改为SSM项目
2022-08-01 09:19:00 【极致千叶】
目录
将Servlet项目改为SSM(Spring Boot+Spring MVC+MyBATIS)项目。
1.先创建SSM项目。



2.设置不同平台的配置文件
2.1.创建不同平台的配置文件
要求:不同平台的配置文件格式必须符合规范。
2.2.在主配置文件中(application.yml)中配置项目的运行平台
spring:
profiles:
active: dev
这样既可完成。
3.配置连接的数据库和 MyBatis 存储 xml 的路径
#开发环境的配置文件
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/myblog2022?characterEncoding=utf8&useSSL=true
username: root
password: 12345678
driver-class-name: com.mysql.cj.jdbc.Driver
#生产环境的配置文件
spring:
datasource:
url: jdbc:mysql://121.5.240.34:3306/myblog2022?characterEncoding=utf8&useSSL=true
username: root
password: 12345678
driver-class-name: com.mysql.cj.jdbc.Driver
主配置文件:
#配置mybatis xml保存路径
mybatis:
mapper-locations: classpath:mybatis/**Mapper.xml 4.将servlet中的前端页面全部复制到ssm项目中的static目录中
5.改造实现业务接口
重点操作MyBatis,
操作两个文件:xxxMapper.java 的接口声明、xxxMapper.xml 实现SQL操作
边栏推荐
猜你喜欢

PerViT: 神经网络也能像人类利用外围视觉一样观察图像!

C语言中编译时出现警告C4013(C语言不加函数原型产生的潜在错误)

Chapter 9 of Huawei Deep Learning Course - Convolutional Neural Network and Case Practice

热修复技术可谓是百花齐放

Microsoft Azure & NVIDIA IoT developers season I | Azure IoT & NVIDIA Jetson development foundation

【无标题】

Microsoft Azure & NVIDIA IoT 开发者季 I|Azure IoT & NVIDIA Jetson 开发基础

YOLOv7-Pose尝鲜,基于YOLOv7的关键点模型测评

VoLTE Basic Learning Series | Enterprise Voice Network Brief

22 Grab the Seat 1 C.Grab the Seat (Geometry + Violence)
随机推荐
Intensive reading of ACmix papers, and analysis of its model structure
22牛客多校1 I. Chiitoitsu (概率dp)
【应用推荐】常见资源管理器整理,含个人使用体验和产品选型推荐
TiDB的真实数据库数据是存在kv和还是pd上?
ogg同步oracle到mysql,字段里面可能有需要转义的字符,怎么配置转义?
Install GBase 8 c database, the error shows "Resource, how to solve?
PerViT: 神经网络也能像人类利用外围视觉一样观察图像!
HoloView -- Tabular Datasets
Shell executes SQL to send emails
获取页面数据的方法
微服务:事务管理
Parsing MySQL Databases: "SQL Optimization" vs. "Index Optimization"
Manual upgrade and optimization tutorial of Lsky Pro Enterprise Edition
STM32个人笔记-嵌入式C语言优化
Pod environment variables and initContainer
Go-Excelize API源码阅读(八)——GroupSheets(sheets []string)、UngroupSheets()
MySQL query advanced - from the use of functions to table joins, do you remember?
22 Niu Ke Duo School 1 I. Chiitoitsu (Probability dp)
热修复技术可谓是百花齐放
GBase 8c中怎么查询数据库配置参数,例如datestyle