完整的application.xml


<!-- 资源文件配置 --><beans profile="dev"><bean class="com.ningpai.util.CustomPropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath:/com/ningpai/web/config/dev/jdbc.properties</value><value>classpath:/com/ningpai/web/config/dev/es-hosts.properties</value><value>classpath:/com/ningpai/web/config/dev/redis.properties</value><value>classpath:/com/ningpai/web/config/dev/amq.properties</value><value>classpath:/com/ningpai/web/config/dev/config.properties</value><value>classpath:/com/ningpai/web/config/dev/kaQuan.properties</value><value>classpath:/com/ningpai/web/config/dev/zjlogin.properties</value><value>classpath:/com/ningpai/web/config/dev/kuaidi100.properties</value><value>classpath:/com/ningpai/web/config/dev/resource.properties</value><value>classpath:/com/ningpai/web/config/dev/czb.properties</value><value>classpath:/com/ningpai/web/config/dev/hzb.properties</value><value>classpath:/com/ningpai/web/config/dev/jlPay.properties</value></list></property></bean></beans>
package com.ningpai.util;import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;import java.util.HashMap;
import java.util.Map;
import java.util.Properties;/*** Created by Intellij Idea** @auth hangzhou.team.rmitec* @company shanghai ruimin internet technology co.ltd* @date 2017/12/12*/
public class CustomPropertyPlaceholderConfigurer extends org.springframework.beans.factory.config.PropertyPlaceholderConfigurer {private static Map<String, String> ctxPropertiesMap = new HashMap<String, String>();@Overrideprotected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,Properties props) throws BeansException {super.processProperties(beanFactoryToProcess, props);for (Object key : props.keySet()) {String keyStr = key.toString();String value = props.getProperty(keyStr);ctxPropertiesMap.put(keyStr, value);}}/*** 读取配置** @param name* @return*/public static String getProperty(String name) {return ctxPropertiesMap.get(name);}
}

完整的application.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"  xmlns:p="http://www.springframework.org/schema/p"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xmlns:task="http://www.springframework.org/schema/task"xmlns:redisson="http://redisson.org/schema/redisson"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsdhttp://www.springframework.org/schema/task  http://www.springframework.org/schema/task/spring-task-4.0.xsdhttp://redisson.org/schema/redissonhttp://redisson.org/schema/redisson/redisson.xsd"><import resource="spring-jcaptcha.xml" /><import resource="spring-plugin.xml" /><!--创建一个Spring Bean的名称springSessionRepositoryFilter实现过滤器。
筛选器负责将HttpSession实现替换为Spring会话支持。在这个实例中,Spring会话得到了Redis的支持。--><bean class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration"><property name="maxInactiveIntervalInSeconds" value="604800"/></bean><bean class="org.springframework.session.web.http.DefaultCookieSerializer"><property name="cookieName" value="JSESSIONID"/></bean><!--创建了一个RedisConnectionFactory,它将Spring会话连接到Redis服务器。我们配置连接到默认端口(6379)上的本地主机!-->
<!--    <bean class="org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory"/>--><!--<osgi:reference  id="dataSource" interface="javax.sql.DataSource" bean-name="dataSource"/>--><bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"init-method="init" destroy-method="close"><property name="driverClassName" value="${jdbc.driver}" /><property name="url" value="${jdbc.url}" /><property name="username" value="${jdbc.username}" /><property name="password" value="${jdbc.password}" /><!-- data source configuration --><property name="initialSize" value="50" /><!-- initial connections --><property name="maxActive" value="200" /><!-- MAX connections --><property name="maxIdle" value="50" /><!-- MAX idle connections --><property name="minIdle" value="10" /><!-- MIN idle connections --><!-- 处理mysql 8小时自动断开连接的问题 --><property name="testWhileIdle" value="true" /><property name="testOnBorrow" value="true" /><property name="testOnReturn" value="false" /><property name="validationQuery" value="select 1" /><property name="validationQueryTimeout" value="15" /><property name="connectionInitSqls" value="set names utf8mb4;"/><property name="timeBetweenEvictionRunsMillis" value="20000" /><property name="numTestsPerEvictionRun" value="100" /><!--属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有:监控统计用的filter:stat日志用的filter:log4j防御SQL注入的filter:wall --><property name="filters" value="${druid.filters}" /></bean><!--事务相关控制--><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"><property name="dataSource" ref="dataSource" /></bean><!-- 事务传播特性 --><bean id="txDefinitionNew" class="org.springframework.transaction.support.DefaultTransactionDefinition"><property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW" /><property name="isolationLevel" value="2"></property></bean><context:component-scan  base-package="com.ningpai,com.qianmi,com.zjfae"/><!--启动注解 @Transactional --><tx:annotation-driven/><!--<tx:advice id="userTxAdvice" transaction-manager="transactionManager"><tx:attributes><tx:method name="*" propagation="REQUIRED" read-only="false" rollback-for="java.lang.Exception"/></tx:attributes></tx:advice><aop:config><aop:pointcut id="pc" expression="execution(* com.ningpai.web.impl.*.*(..)) " />把事务控制在Business层<aop:advisor pointcut-ref="pc" advice-ref="userTxAdvice" /></aop:config>--><!-- MyBatis sqlSessionFactory 配置 mybatis--><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><property name="configLocation"value="classpath:/com/ningpai/web/mybatis/SqlMapConfig.xml" /><property name="dataSource" ref="dataSource" /><property name="mapperLocations"><array><value>classpath*:com/qianmi/*/mapper/**/*.xml</value><value>classpath*:com/ningpai/mybatis/mapper/DepositInfoMapper.xml</value><value>classpath*:com/ningpai/mybatis/mapper/TradeInfoMapper.xml</value></array></property></bean><bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"><constructor-arg index="0" ref="sqlSessionFactory" /></bean><!-- 设置字段内容长度,这里不做限定   --><bean id="mappingJacksonHttpMessageConverter"class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" /><!--esClientManager,设置为单例--><bean id="esClientManager" class="com.ningpai.searchplatform.client.ESClientManager" scope="singleton"><constructor-arg index="0" type="java.lang.String"><value>${es.hosts}</value></constructor-arg><constructor-arg index="1" type="java.lang.String" value="${es.cluster.name}"/></bean><!-- 线程池 --><!--spring线程池--><bean id="threadPool" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"><!--核心线程数--><property name="corePoolSize" value="20"/><!--最大线程数--><property name="maxPoolSize" value="50"/><!--队列最大长度--><property name="queueCapacity" value="200"/><!--线程池维护线程所允许的空闲时间--><property name="keepAliveSeconds" value="300"/><!--程序关闭时等待线程执行完毕--><property name="waitForTasksToCompleteOnShutdown" value="true"/></bean><task:scheduled-tasks><task:scheduled ref="RefundmentUtil" method="service" cron="0 0 12 * * ?" /></task:scheduled-tasks><bean id="redisAdapter" class="com.ningpai.redis.RedisAdapter" scope="singleton"></bean><bean id="redisProductCache" class="com.zjfae.goods.redis.RedisProductCache" scope="singleton"></bean><bean id="redisMarketingCache" class="com.qianmi.marketing.redis.RedisMarketingCache" scope="singleton"></bean><bean id="redisTopicCache" class="com.zjfae.topic.redis.RedisTopicCache" scope="singleton"></bean><bean id="SpringApplicationContext" class="com.ningpai.common.util.ApplicationContextHelper"></bean><bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig"><property name="maxIdle" value="${redis.maxIdle}" /><property name="maxTotal" value="${redis.maxActive}" /><property name="maxWaitMillis" value="${redis.maxWait}" /><property name="testOnBorrow" value="${redis.testOnBorrow}" /></bean><bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"p:host-name="${redis.host}" p:port="${redis.port}"  p:database="${redis.dbIndex}"  p:pool-config-ref="poolConfig"/><bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate"><property name="connectionFactory"   ref="connectionFactory" /></bean><!--redission 相关配置 请勿改动 --><redisson:client id="redissonClient"><redisson:single-server address="redis://${redis.host}:${redis.port}" /></redisson:client><bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"><property name="dataSource" ref="dataSource"></property></bean><!--wxClientCredential--><bean id="wxClientCredential" class="com.ningpai.m.weixin.util.WxClientCredential" scope="singleton" /><bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"><property name="basePackage" value="com.ningpai.deposit.mapper,com.qianmi.marketing.dao,com.ningpai.marketing.dao.point,com.qianmi.coupon.mapper,com.qianmi.couponGroup.dao,com.qianmi.couponRedeem.dao,com.qianmi.newCustomerConfig.dao,com.qianmi.receive.dao,com.qianmi.promotioner.dao,com.ningpai.report.dao,com.ningpai.dict.dao,com.ningpai.commentResources.dao,com.ningpai.customer.dao.balance,com.ningpai.customer.dao.channelCustomerInfo,com.ningpai.customermerge.dao,com.ningpai.customerOption.dao,com.ningpai.privacyAgreement.dao,com.ningpai.system.dao.weixin,com.ningpai.system.dao.channelSet,com.ningpai.system.dao.outlet,com.ningpai.system.dao.common,com.zjfae.goods.dao,com.qianmi.site.common.dao,com.qianmi.marketing.groupon.dao,com.qianmi.invoice.dao,com.zjfae.flow.dao,com.zjfae.common.dao,com.zjfae.strategy.dao,com.zjfae.hop.dao,com.zjfae.jushuitan.dao,com.zjfae.nuonuo.dao,com.zjfae.report.dao,com.zjfae.share.dao,com.zjfae.goods.dao,com.zjfae.topic.dao,com.zjfae.order.daocom.ningpai.system.trans.dao,com.zjfae.white.dao,com.zjfae.vending.dao,com.ningpai.goods.dao.unexpress,com.ningpai.customer.dao.zjfae,com.ningpai.customer.dao.shareApply,com.zjfae.pay.dao,com.zjfae.page.dao,com.zjfae.domain.dao,com.zjfae.wxlogistics.dao,com.zjfae.log.dao,com.ningpai.goods.dao.erp,com.ningpai.marketing.dao.receiveRecord"/></bean><import resource="classpath*:spring-amq.xml"/><import resource="classpath*:spring-promotioner.xml"/><!-- 资源文件配置 --><beans profile="dev"><bean class="com.ningpai.util.CustomPropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath:/com/ningpai/web/config/dev/jdbc.properties</value><value>classpath:/com/ningpai/web/config/dev/es-hosts.properties</value><value>classpath:/com/ningpai/web/config/dev/redis.properties</value><value>classpath:/com/ningpai/web/config/dev/amq.properties</value><value>classpath:/com/ningpai/web/config/dev/config.properties</value><value>classpath:/com/ningpai/web/config/dev/kaQuan.properties</value><value>classpath:/com/ningpai/web/config/dev/zjlogin.properties</value><value>classpath:/com/ningpai/web/config/dev/kuaidi100.properties</value><value>classpath:/com/ningpai/web/config/dev/resource.properties</value><value>classpath:/com/ningpai/web/config/dev/czb.properties</value><value>classpath:/com/ningpai/web/config/dev/hzb.properties</value><value>classpath:/com/ningpai/web/config/dev/jlPay.properties</value></list></property></bean></beans><beans profile="test"><bean class="com.ningpai.util.CustomPropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath:/com/ningpai/web/config/test/jdbc.properties</value><value>classpath:/com/ningpai/web/config/test/es-hosts.properties</value><value>classpath:/com/ningpai/web/config/test/redis.properties</value><value>classpath:/com/ningpai/web/config/test/amq.properties</value><value>classpath:/com/ningpai/web/config/test/config.properties</value><value>classpath:/com/ningpai/web/config/test/kaQuan.properties</value><value>classpath:/com/ningpai/web/config/test/zjlogin.properties</value><value>classpath:/com/ningpai/web/config/test/kuaidi100.properties</value><value>classpath:/com/ningpai/web/config/test/resource.properties</value><value>classpath:/com/ningpai/web/config/test/czb.properties</value><value>classpath:/com/ningpai/web/config/test/hzb.properties</value><value>classpath:/com/ningpai/web/config/test/jlPay.properties</value></list></property></bean></beans><beans profile="uat"><bean class="com.ningpai.util.CustomPropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath:/com/ningpai/web/config/uat/jdbc.properties</value><value>classpath:/com/ningpai/web/config/uat/es-hosts.properties</value><value>classpath:/com/ningpai/web/config/uat/redis.properties</value><value>classpath:/com/ningpai/web/config/uat/amq.properties</value><value>classpath:/com/ningpai/web/config/uat/config.properties</value><value>classpath:/com/ningpai/web/config/uat/kaQuan.properties</value><value>classpath:/com/ningpai/web/config/uat/zjlogin.properties</value><value>classpath:/com/ningpai/web/config/uat/kuaidi100.properties</value><value>classpath:/com/ningpai/web/config/uat/resource.properties</value><value>classpath:/com/ningpai/web/config/uat/czb.properties</value><value>classpath:/com/ningpai/web/config/uat/hzb.properties</value><value>classpath:/com/ningpai/web/config/uat/jlPay.properties</value></list></property></bean></beans><beans profile="prd"><bean class="com.ningpai.util.CustomPropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath:/com/ningpai/web/config/prd/jdbc.properties</value><value>classpath:/com/ningpai/web/config/prd/es-hosts.properties</value><value>classpath:/com/ningpai/web/config/prd/redis.properties</value><value>classpath:/com/ningpai/web/config/prd/amq.properties</value><value>classpath:/com/ningpai/web/config/prd/config.properties</value><value>classpath:/com/ningpai/web/config/prd/kaQuan.properties</value><value>classpath:/com/ningpai/web/config/prd/zjlogin.properties</value><value>classpath:/com/ningpai/web/config/prd/kuaidi100.properties</value><value>classpath:/com/ningpai/web/config/prd/resource.properties</value><value>classpath:/com/ningpai/web/config/prd/czb.properties</value><value>classpath:/com/ningpai/web/config/prd/hzb.properties</value><value>classpath:/com/ningpai/web/config/prd/jlPay.properties</value></list></property></bean></beans>
</beans>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/51848.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

从零学算法79

79.给定一个 m x n 二维字符网格 board 和一个字符串单词 word 。如果 word 存在于网格中&#xff0c;返回 true &#xff1b;否则&#xff0c;返回 false 。 单词必须按照字母顺序&#xff0c;通过相邻的单元格内的字母构成&#xff0c;其中“相邻”单元格是那些水平相邻或垂直…

基于BP神经网络的火焰识别,基于BP神经网络的火灾识别

目标 背影 BP神经网络的原理 BP神经网络的定义 BP神经网络的基本结构 BP神经网络的神经元 BP神经网络的激活函数, BP神经网络的传递函数 代码链接:基于BP神经网络的火焰识别,基于BP神经网络的火灾识别资源-CSDN文库 https://download.csdn.net/download/abc991835105/88215…

怎么检测UI卡顿?(线上及线下)

什么是UI卡顿&#xff1f; 在Android系统中&#xff0c;我们知道UI线程负责我们所有视图的布局&#xff0c;渲染工作&#xff0c;UI在更新期间&#xff0c;如果UI线程的执行时间超过16ms&#xff0c;则会产生丢帧的现象&#xff0c;而大量的丢帧就会造成卡顿&#xff0c;影响用…

Matlab彩色图像转索引图像

索引图像 索引图像是一种把像素值直接作为RGB调色板下标的图像。索引图像包括一个数据矩阵X&#xff0c;一个调色板矩阵map&#xff0c;也称为颜色映像矩阵。其中&#xff0c;数据矩阵X可以是8位无符号整型、16位无符号整型或双精度类型。调色板矩阵map是一个m3的数据阵列&…

Adapting Language Models to Compress Contexts

本文是LLM系列文章&#xff0c;针对《Adapting Language Models to Compress Contexts》的翻译。 使语言模型适应上下文压缩 摘要1 引言2 相关工作3 方法4 实验5 上下文学习6 压缩检索语料库实现高效推理7 结论不足 摘要 1 引言 2 相关工作 3 方法 4 实验 5 上下文学习 …

亚马逊云科技CEO谈及企业领导力原则的核心:坚持顾客至上

亚马逊云科技首席执行官Adam Selipsky几乎从一开始就在那里&#xff1a;他于2005年加入&#xff0c;在效力亚马逊11年后于2016年离开&#xff0c;转而经营Tableau&#xff0c;并于2021年成为亚马逊云科技首席执行官。当时亚马逊云科技前首席执行官安迪贾西(Andy Jassy)接替杰夫…

大数据(一)定义、特性

大数据&#xff08;一&#xff09;定义、特性 本文目录&#xff1a; 一、写在前面的话 二、大数据定义 三、大数据特性 3.1、大数据的大量 (Volume) 特性 3.2、大数据的高速(Velocity)特性 3.3、大数据的多样化 (Variety) 特性 3.4、大数据的价值 (value) 特性 3.5、大…

废品回收抢单派单小程序开源版开发

废品回收抢单派单小程序开源版开发 用户注册和登录&#xff1a;用户可以通过手机号码注册和登录小程序&#xff0c;以便使用废品回收抢单派单功能。废品回收订单发布&#xff1a;用户可以发布废品回收订单&#xff0c;包括废品种类、数量、回收地点等信息。废品回收抢单&#…

React通过docx-preview预览Word文档

前言 在基于React的Web应用中&#xff0c;我们经常遇到需要预览和展示Word文档的需求。而docx-preview是一个优秀的React组件库&#xff0c;可以帮助我们实现在Web页面上预览Word文档的功能。本文将介绍如何使用docx-preview组件来实现Word文档的预览&#xff0c;并提供一个案例…

编解码视频测试序列集

https://kodi.wiki/view/Samples https://ultravideo.fi/#testsequences 原文&#xff1a;http://forum.doom9.org/archive/index.php/t-135034.html his thread is meant to hold links and references to test video clip sequences intended to be used for various video…

Linux 网络文件共享介绍

Linux 网络文件共享介绍 一.常见的存储类型 目前常见的存储类型有 DAS,NAS,SAN 等&#xff0c;最主要的区别是硬盘存储媒介是如何 于处理器连接的&#xff0c;以及处理器使用何种方式来访问磁盘&#xff0c;以及访问磁盘使用 的协议(网络协议、I/O 协议)。 三种存储类型如下 直…

JavaScript箭头函数

Arrow Functions&#xff08;箭头函数&#xff09;是 ES6 中引入的一种新的函数表达式语法&#xff0c;它可以更简洁地定义函数&#xff0c;并且不需要像普通函数一样使用 function 关键字。 例如我们上节课的代码&#xff1a; const peopleAge function calcAge1(birthYear)…

vue3+ts+uniapp小程序端自定义日期选择器基于内置组件picker-view + 扩展组件 Popup 实现自定义日期选择及其他选择

vue3ts 基于内置组件picker-view 扩展组件 Popup 实现自定义日期选择及其他选择 vue3tsuniapp小程序端自定义日期选择器 1.先上效果图2.代码展示2.1 组件2.2 公共方法处理日期2.3 使用组件 3.注意事项3.1refSelectDialog3.1 backgroundColor"#fff" 自我记录 1.先上…

error: can‘t find Rust compiler

操作系统 win11 pip install -r requirements.txt 报错如下 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/56/fc/a3c13ded7b3057680c8ae95a9b6cc83e63657c38e0005c400a5d018a33a7/pyreadline3-3.4.1-py3-none-any.whl (95 kB) Building wheels for collected p…

哲讯科技携手无锡华启动SCM定制化项目,共谋数字化转型之路

无锡华光座椅弹簧有限公司启动SCM定制化项目 近日&#xff0c;无锡华光座椅弹簧有限公司顺利举行了SCM定制化项目的启动会。本次启动会作为该项目实施的重要里程碑&#xff0c;吸引了双方项目组核心成员的共同参与&#xff0c;并见证了项目的正式启动。 无锡华光座椅弹簧有限公…

Angular中如何获取URL参数?

Angular中的ActivatedRoute中保存着路由信息&#xff0c;可用来提取URL中的路由参数。 constructor(private route: ActivatedRoute){}ngOnInit(): void {this.getUser();}getUser(): void {const id this.route.snapshot.paramMap.get(id);} }route.snapshot是一个路由信息的…

计算机网络面试题

文章目录 描述HTTP和HTTPS的区别Cookie和Session有什么区别BIO、NIO、AIOTCP三次握手和四次挥手跨域请求是什么&#xff1f;有什么问题&#xff1f;怎么解决&#xff1f;网页输入url&#xff0c;到渲染整个界面的整个过程&#xff0c;以及中间件用了什么协议Rest、RestfulTCP的…

Java开发工作问题整理与记录

1、为什么Autowired不能注入static成员属性 扫描Class类需要注入的元数据的时候&#xff0c;直接选择忽略掉了static成员&#xff08;包括属性和方法&#xff09; Spring 依赖注入是依赖set方法, set方法是普通的对象方法,static变量是类的属性 AutowiredAnnotationBeanPostP…

嵌入式开发之堆栈调试打印

简介 打印堆栈的常用方法包括&#xff1a; glibc中的backtrace函数gcc内置函数__builtin_return_address第三方库libunwind 1 glibc中的backtrace 1. 1函数原型 #include <execinfo.h>/** 功能: 获取当前线程的调用堆栈并存放在buffer中(指向字符串数组的指针)* par…

【C语言】动态内存管理(malloc,free,calloc,realloc)-- 详解

一、动态内存分配 定义&#xff1a;动态内存分配 (Dynamic Memory Allocation) 就是指在程序执行的过程中&#xff0c;动态地分配或者回收存储空间的分配内存的方法。动态内存分配不像数组等静态内存分配方法那样&#xff0c;需要预先分配存储空间&#xff0c;而是由系统根据程…