首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 互联网 >

Spring AOP—三、简单的例子

2012-09-10 
Spring AOP—3、简单的例子这个例子使用之前Spring—spring mvc框架入门?xml version1.0 encodingUTF-8

Spring AOP—3、简单的例子


这个例子使用之前Spring—spring mvc框架入门<?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:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"> <context:component-scan base-package="yuxd.sample" ></context:component-scan> <mvc:annotation-driven></mvc:annotation-driven> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="suffix" value=".jsp"></property> <property name="prefix" value="WEB-INF/views/"></property> </bean> <aop:aspectj-autoproxy/> </beans>这里就是多加了个<aop:aspectj-autoproxy/>,这样可以让标注了@Aspect的类自动的代理关注的那些类(被切到的那些类)

例子很简单吧?有问题可以留言


热点排行