Spring基于注解的配置
<context:component-scan base-package="com.txazo" />
<context:component-scan base-package="com.txazo"><context:include-filter type="regex"expression=".dao.impl.*" /><context:include-filter type="regex"expression=".service.impl.*" /><context:include-filter type="regex"expression=".action.*" /></context:component-scan>
<context:annotation-config />
<aop:aspectj-autoproxy />
<bean />
<tx:annotation-driven transaction-manager="transactionManager" />
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/ spring-context-3.0.xsd"><!-- Spring Component Scan --><context:component-scan base-package="com.txazo" /><!-- Spring AOP Aspectj Autoproxy --><aop:aspectj-autoproxy /><!-- Spring DataAccessException Annotated With @Repository --><bean /><!-- SessionFactory --><bean id="sessionFactory" /><!-- HibernateTemplate --><bean id="hibernateTemplate" /><!-- TransactionManager --><bean id="transactionManager" /><!-- Declarative Transaction Management --><tx:annotation-driven transaction-manager="transactionManager" /></beans>