配置springmvc的aop时出错:
当我向配置文件中添加:<aop:aspectj-autoproxy proxy-target-class="true"/> 时出错:
The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 16 in XML document from
class path resource [springmvc.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The prefix "aop" for element "aop:aspectj-autoproxy"
is not bound.
解决方法:
添加这些有关AOP的配置:
xmlns:aop="http://www.springframework.org/schema/aop"
和
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"
添加后如下面所示:
<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"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
spring配置文件详解:
http://blog.csdn.net/zzjjiandan/article/details/22922847
版权声明:本文为博主原创文章,未经博主允许不得转载。