spring配置文件注意事项

来源:互联网 发布:极限兑换空间知轩藏书 编辑:程序博客网 时间:2024/05/21 22:59

 

好久么有平配置Springl的applacationContext.xml文件了,今天就鬼使神差的配出了上面那样的就一直报错。结果整了我一下午,原来是<!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-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">

   .......

   .......

</beans>

不能同时配置在一起,二者选其一即可。

因此应该配成这样:

 

或者这样:

原创粉丝点击