Java开发框架--spring-mvc.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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!--引入配置属性文件 http://blog.csdn.net/happy_wu/article/details/60965959-->
<context:property-placeholder location="classpath:config.properties"
ignore-unresolvable="true" />
<!--自动扫描含有@Service将其注入为bean 既然spring-servlet.xml中已经配置过了,为什么这里还是要配置?-->
<context:component-scan base-package="com.app.service">

</context:component-scan>
<!--用于高并非,多线程。可被池化的对象的配置。
http://blog.csdn.net/chaofanwei2/article/details/51291401-->
<bean name="genericObjectPoolConfig" class="org.apache.commons.pool2.impl.GenericObjectPoolConfig">
<property name="maxWaitMillis" value="-1" /><!--maxWaitMillis:从idle队列里面取对象时,若阻塞的话,则最大等待时长-->
<property name="maxTotal" value="1000" />
<property name="minIdle" value="8" />
<property name="maxIdle" value="100" />
</bean>
<!-- redis集群 -->
<bean id="jedisCluster" class="com.app.redis.JedisClusterFactory">
<property name="addressConfig">
<value>classpath:config.properties</value>
</property>
<property name="addressKeyPrefix" value="address" /> <!-- 属性文件里 key的前缀 -->

<property name="timeout" value="300000" />
<property name="maxRedirections" value="6" />
<property name="genericObjectPoolConfig" ref="genericObjectPoolConfig" />
</bean>
</beans>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值