Java开发框架--spring-mvc.xml 配置详解
2017-03-10 23:07
651 查看
<?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>
<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>
相关文章推荐
- Java开发框架--spring-servlet.xml 配置详解
- Java开发框架--spring-myBatis.xml 配置详解
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- Java开发框架--log4j.xml 配置详解
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- java注解方式(不用xml)配置web框架spring+SpringMVC
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- JavaWeb---框架SpringMvc+Mybatis开发项目第三季(共三季)
- Spring 总结XML配置的十二个最佳实践-Java基础-Java-编程开发
- spring+springMVC+JPA配置详解(使用缓存框架ehcache)
- java web,从零开始,一步一步配置ssm(Spring+SpringMVC+MyBatis)框架
- SSM(Spring+Spring MVC+Mybatis)环境框架搭建与配置详解
- SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释
- Java的MyBatis框架中关键的XML字段映射的配置参数详解
- SPRING IN ACTION 第4版笔记-第七章Advanced Spring MVC-002- 在xml中引用Java配置文件,声明DispatcherServlet、ContextLoaderListener
- web.xml中spring/springmvc配置详解