Spring configuration file quick lookup

<!--spring scan package @Service ..... Note to exclude the scan of the Controller layer -->
	<context:component-scan base-package="com.awcloud">
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
	</context:component-scan>
	
    <context:annotation-config/>



The <context:include-filter> child node represents the target class to be included
<context:exclude-filter> child nodes represent target classes to be excluded



<!-- Configure database connection -->
	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
		<property name="driverClass" value="${driverClass}"/>
		<property name="jdbcUrl" value="${jdbcUrl}"></property>
		<property name="user" value="${user}" />
		<property name="password" value="${password}"/>
	</bean>



<!-- Configure global date converter -->
	<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
		<property name="webBindingInitializer">
			<bean class="com.awcloud.core.web.CustomDateEdtor"/>
		</property>
	</bean>


<!-- spring transaction-->
	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="dataSource"/>
	</bean>
	<!-- Open transaction annotation-->
	<tx:annotation-driven transaction-manager="transactionManager"/>



<!-- Read jdbc configuration-->
	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<list>
				<!-- jdbc configuration-->
				<value>classpath:properties/jdbc.properties</value>
				<!-- memcached configuration-->
			</list>
		</property>
	</bean>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326967269&siteId=291194637