日期:2014-05-17  浏览次数:20705 次

spring AOP在实际项目中的应用.
spring 在实际项目应用中都会用aop做些什么工作,这些工作是通过哪些点实现的,具体的作用是啥。
spring的处理流程是什么样子。
本人正在学习spring的aop 感觉好迷茫。在ssh实际的开发没发现有用到aop的迹象。
最好能有实例。



------解决方案--------------------
权限管理、表单验证、事务管理、信息过滤、拦截器、过滤器、页面转发等等。
------解决方案--------------------
主要是事务那个地方,采用申明式的事务配置方式,是它给你封装好了。
------解决方案--------------------
探讨

权限管理、表单验证、事务管理、信息过滤、拦截器、过滤器、页面转发等等。

------解决方案--------------------
举个例子给你

<aop:config>
<aop:pointcut id="bussinessService"
expression="execution(public * com.honglin.service..*.*(..))" />
<aop:advisor pointcut-ref="bussinessService"
advice-ref="txAdvice" />
</aop:config>

<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="find*" read-only="true" />
<tx:method name="add*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
这个就是事物和AOP 的关系