在spring3与web.xml的环境中使用spring的profile
spring-ftp-file-service.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd" profile="gqbjbi,gqbjlsxk,gqhbbs"> <bean id="ftpFileMsgConsumerService" class="cn.xx.FtpFileMsgConsumerService"> </bean> </beans>
WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>xxx</display-name> <context-param> <param-name>spring.profiles.default</param-name> <param-value>gqbjlsxk</param-value> </context-param> <welcome-file-list> <welcome-file>/index.jsp</welcome-file> </welcome-file-list> <jsp-config> <taglib> <taglib-uri>http://www.xx.cn/xx</taglib-uri> <taglib-location>/WEB-INF/xx.tld</taglib-location> </taglib> </jsp-config> </web-app>
相关推荐
目录一、Spring中的Profile二、为什么要使用Profile三、配置Profile示例四、激活Profile的方式 一、Spring中的Profile Spring中的Profile功能可以理解为我们在Spring容器中所定义的Bean的逻辑组名称,只有当这些...
结合2,3使用,可以在很多配置处,写出比如这样的表达式 以减少不同环境下,配置文件切换的需要 ${JAVA_HOME}/com/bank/service/${env}-config.xml"/> 5、xml的什么,不感兴趣 6、hibernate4支持,不感兴趣 7、...
Profile是Spring Boot 对不同环境下提供不同配置功能的支持
在Spring Boot中,可以使用配置文件来管理应用程序的配置。这些配置文件可以根据不同的环境进行分离和管理,Spring...Spring Boot还提供了更多高级的配置方式,如使用@Profile注解、条件注解等来实现更精细的配置管理。
什么是spring profile...简单讲profile就是一组配置,不同profile提供不同组合的配置,程序运行时可以选择使用哪些profile来适应环境。下面这篇文章主要介绍了Spring中Profile实战的相关资料,需要的朋友可以参考借鉴。
1.2.2 使用Spring Initializr初始化Spring Boot项目 10 1.3 小结 18 第2章 开发第一个应用程序 19 2.1 运用Spring Boot 19 2.1.1 查看初始化的Spring Boot新项目 21 2.1.2 Spring Boot项目构建过程解析 ...
,springboot支持通过不同的profile来配置不同环境的配置,下面就大致介绍一下yml配置文件跟properties配置文件怎么使用profile配置不同环境的配置文件
主要介绍了spring Profile如何为不同环境提供不同的配置支持,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
主要介绍了 spring profile 多环境配置管理详解的相关资料,需要的朋友可以参考下
本篇文章主要介绍了spring @profile注解的使用方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
1.2.2 使用Spring Initializr初始化Spring Boot项目 10 1.3 小结 18 第2章 开发第一个应用程序 19 2.1 运用Spring Boot 19 2.1.1 查看初始化的Spring Boot新项目 21 2.1.2 Spring Boot项目构建过程...
Spring Boot Documentation 1. About the Documentation 2. Getting Help 3. First Steps 4. Working with Spring Boot 5. Learning about Spring Boot Features 6. Moving to Production 7. Advanced Topics II. ...
SpringBoot中的Profile配置的使用示例源码
主要介绍了通过实例了解Spring中@Profile的作用,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
主要介绍了使用Spring boot 的profile功能实现多环境配置自动切换的相关知识,非常不错,具有一定的参考借鉴价值 ,需要的朋友可以参考下
本篇文章主要介绍了Spring Boot的Profile配置详解,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Native profile support Building a server-side application Building a client-side application Adding a Eureka Server Client-side bootstrap approaches Config Server discovery Repository backend types ...
主要介绍了浅谈spring注解之@profile,@profile通过配置来改变参数,这里整理的详细的用法,有兴趣的可以了解一下
涵盖使用Spring Boot 进行Java EE 开发的绝大数应用场景,包含:Web 开发、数据访问、安全控制、批处理、异步消息、系统集成、开发与部署、应用监控、分布式系统开发等。 第一部分 点睛Spring 4.x 第1 章 Spring ...
Profile模式 配置文件优先级 外部配置加载顺序自动配置原理 日志处理 日志框架介绍 SLF4j的使用日志关系 日志的使用 Web实战 创建项目 静态资源映射规则模板引擎 Thymeleaf使用 Thymeleaf语法 Spring MVC自动配置...