这是DOCTYPE
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd:/spring-beans.dtd">
这是beans里的配置
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
报错信息:]
Multiple annotations found at this line:
The content of element type "beans" must match "(description?,(import|alias| bean)*)".
Attribute "xsi:schemaLocation" must be declared for element type "beans".
Attribute "xmlns:xsi" must be declared for element type "beans".
Attribute "xmlns" must be declared for element type "beans".
Attribute "xmlns:tx" must be declared for element type "beans".
Attribute "xmlns:aop" must be declared for element type "beans".
求大神,
你试试
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
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.xsd">
<!-- Spring AOP 日志管理 -->
<!-- 将日志类注入到bean中 -->
<bean id="advices" class="advice.Advices"></bean>
<aop:config>
<!-- 调用日志类 -->
<aop:aspect id="advice" ref="advices">
<aop:pointcut expression="execution(* action.*.*(..))" id="log"/>
<aop:before method="before" pointcut-ref="log"/>
<aop:after method="afterReturning" pointcut-ref="log"/>
<aop:after-throwing method="afterThrowing" pointcut-ref="log"/>
</aop:aspect>
</aop:config>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。