Spring加载指定环境的配置文件
来源:互联网 发布:mac是哪个国家 编辑:程序博客网 时间:2024/04/24 04:51
1、Web.xml,配置使用哪种环境信息,tomcat启动的时候自动去加载对应的环境信息
<display-name>显示名称</display-name> <!-- spring服务层的配置文件 --><!-- 指定系统环境 --><context-param> <param-name>spring.profiles.active</param-name> <!--<param-value>${profiles.activation}</param-value>--><param-value>deploy</param-value></context-param><context-param><param-name>contextConfigLocation</param-name><param-value>classpath*:spring/*.xml</param-value></context-param>
2、Sping.xml配置加载/config/config.propertiess
<beans profile="deploy"><bean id="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="locations"> <list> <value>file:/config/config.propertiess</value> </list> </property> <property name="fileEncoding" value="UTF-8" /> </bean> </beans>
0 0
- Spring加载指定环境的配置文件
- spring配置文件的加载
- Spring MVC 根据不同环境加载不同的配置文件
- 指定spring配置文件的位置
- maven 不同环境加载不同spring配置文件
- Spring的配置文件中加载配置文件
- spring加载配置文件的方式
- spring加载配置文件的方式
- spring 加载配置文件的方式
- spring的模块化配置文件加载
- spring自定义配置文件的加载
- 指定spring配置文件的位置 ContextLoaderListener DispatcherServlet
- spring-boot在不同的环境启动加载不同的配置文件
- spring在javaWeb环境中加载 bean 配置文件方式的选择
- Spring环境搭建之:通过PropertyPlaceholderConfigurer加载属性配置文件:
- spring 中加载xml配置文件的方式.
- spring 中加载xml配置文件的方式.
- 加载spring配置文件的工具类
- SE11 仅以有限的方式支持生成的 DDL SQL 视图
- leetcode 22. Generate Parentheses
- 【bzoj3144】[Hnoi2013]切糕
- 第五六单元练习题
- Lucene系列
- Spring加载指定环境的配置文件
- 《Android编程权威指南》 学习笔记(一)
- 封装请求参数Page对象
- Redis工具类
- Oracle增删改查
- NSTimer详解----使用、保留环问题、与runloop的关系
- 编辑距离
- chmod命令
- SpringBoot项目在IntelliJ IDEA中实现热部署