记录一下springMVC项目的多环境的切换。基于springprofile。
1、简单实现
1 首先将配置文件进行分离,分成relaese(本地环境)、uat(测试环境)、dg(生产环境)
2、applicationContext.xml配置加载数据库配置文件信息
3、spring-mvc.xml配置加载环境下的配置文件
4、配置项目tomcat运行输入参数-Dspring.profiles.active=release,等于后加环境的内容,即可实现多环境配置。
5、远程服务器端tomcat配置
conf目录下的context.xml文件
springMVC的多环境配置_基于spring.profiles.active
最新推荐文章于 2024-06-08 14:56:49 发布