首页 > 代码库 > spring配置,spring中的bean 的id不能相同
spring配置,spring中的bean 的id不能相同
lib下加入包
spring.jar
commons-logging.jar
src下添加 applicationContext.xml
1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://www.springframework.org/schema/beans 5 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> 6 <import 7 resource="cn/itcast/spring/sh/ioc/createobject/applicationContext-createobject.xml" /> 8 <import resource="cn/itcast/spring/sh/ioc/alias/applicationContext-alias.xml" /> 9 10 <import resource="cn/itcast/spring/sh/createobject/method/applicationContext-createobject-method.xml" /> 11 12 <!-- <import resource="cn/itcast/spring/sh/createobject/when/applicationContext-createobejct-when.xml" /> --> 13 14 <!-- <import resource="cn/itcast/spring/sh/scope/applicationContext-scope.xml" /> --> 15 16 <!-- <import resource="cn/itcast/spring/sh/initdestroy/applicationContext-initdestroy.xml" /> --> 17 18 <!-- <import resource="cn/itcast/spring/sh/di/set/applicationContext-di-set.xml" /> --> 19 20 <!-- <import resource="cn/itcast/spring/sh/di/constructor/applicationContext-di-constructor.xml" /> --> 21 22 <!-- <import resource="cn/itcast/spring/sh/document/applicationContext-document.xml" /> --> 23 24 <!-- <import resource="cn/itcast/spring/sh/mvc/applicationContext-mvc.xml"/> --> 25 </beans>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。