当前位置:网站首页>将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操作
边栏推荐
猜你喜欢

leetcode-6133: maximum number of groupings

Redis中间件(从搭建到弃坑)

Parsing MySQL Databases: "SQL Optimization" vs. "Index Optimization"

【数据集】各类绝缘子、鸟巢及防震锤数据集汇总

三子棋(C语言实现)

《时代》杂志:元宇宙时代将改变世界

Analysis of High Availability Solution Based on MySql, Redis, Mq, ES

leetcode-6132:使数组中所有元素都等于零

leetcode-6132: Make all elements in array equal to zero

Detailed explanation of JVM runtime data area and JMM memory model
随机推荐
sqlserver 对比两张表的差异
centos 安装php7.4,搭建hyperf,转发RDS
Prime Ring Problem(素数环问题)
网络个各种协议
Microsoft Azure & NVIDIA IoT 开发者季 I|Azure IoT & NVIDIA Jetson 开发基础
套接字选项
HoloView--Customization
SkiaSharp 之 WPF 自绘 五环弹动球(案例版)
Prime Ring Problem
HoloView 在 jyputer lab/notebook 不显示总结
Delphi MDI appliction 文档最大化显示、去掉最大化最小化等按钮
Microsoft Azure & NVIDIA IoT developers season I | Azure IoT & NVIDIA Jetson development foundation
[Tear AHB-APB Bridge by hand]~ Why aren't the lower two bits of the AHB address bus used to represent the address?
The soul asks: How does MySQL solve phantom reads?
Leetcode - 6135: the longest part of the figure
Install GBase 8 c database, the error shows "Resource, how to solve?
372. 超级次方
Mysql database deployment and initialization steps
How to query database configuration parameters in GBase 8c, such as datestyle
18张图,直观理解神经网络、流形和拓扑