Configuration series: Simple configuration of Applicationcontext.xml in SSM

Source: Internet
Author: User

<?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:p= "http://www.springframework.org/schema/p"

xmlns:context= "Http://www.springframework.org/schema/context"

Xmlns:mvc= "Http://www.springframework.org/schema/mvc"

xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans.xsd

Http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd

Http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd " >


<!--Configure the service package scan, automatically inject service-->

<context:component-scan base-package= "Com.simple"/>


<!--Use the spring-brought placeholder replacement feature-

<bean

class= "Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >

<!--allow JVM parameters to be overwritten--

<property name= "Systempropertiesmodename" value= "System_properties_mode_override"/>

<!--ignore resource files not found--

<property name= "Ignoreresourcenotfound" value= "true"/>

<!--configuring resource Files--

<property name= "Locations" >

<list>

<value>classpath:jdbc.properties</value>

<value>classpath:env.properties</value>

</list>

</property>

</bean>


<!--database connection pool--

<bean id= "DataSource" class= "Com.jolbox.bonecp.BoneCPDataSource"

destroy-method= "Close" >

<!--database-driven

<property name= "Driverclass" value= "${jdbc.driver}"/>

<!--the corresponding drive Jdbcurl--

<property name= "Jdbcurl" value= "${jdbc.url}"/>

<!--database user name--

<property name= "username" value= "${jdbc.username}"/>

<!--database Password--

<property name= "Password" value= "${jdbc.password}"/>

<!--Check the time interval for idle connections in the database connection pool, in units of minutes, default: 240, if you want to cancel, set to 0--

<property name= "idleconnectiontestperiod" value= "/>"

<!--the maximum lifetime of unused links in a connection pool, in units of minutes, default: 60, if you want to live forever set to 0--

<property name= "idlemaxage" value= "/>"

<!--The maximum number of connections per partition--

<property name= "maxconnectionsperpartition" value= "/>"

<!--the minimum number of connections per partition--

<property name= "Minconnectionsperpartition" value= "5"/>

</bean>

</beans>


Configuration series: Simple configuration of Applicationcontext.xml in SSM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.