spring配置,spring中的bean 的id不能相同
lib下加入包
spring.jar
commons-logging.jar
src下添加 applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<import
resource="cn/itcast/spring/sh/ioc/createobject/applicationContext-createobject.xml" />
<import resource="cn/itcast/spring/sh/ioc/alias/applicationContext-alias.xml" /> <import resource="cn/itcast/spring/sh/createobject/method/applicationContext-createobject-method.xml" /> <!-- <import resource="cn/itcast/spring/sh/createobject/when/applicationContext-createobejct-when.xml" /> --> <!-- <import resource="cn/itcast/spring/sh/scope/applicationContext-scope.xml" /> --> <!-- <import resource="cn/itcast/spring/sh/initdestroy/applicationContext-initdestroy.xml" /> --> <!-- <import resource="cn/itcast/spring/sh/di/set/applicationContext-di-set.xml" /> --> <!-- <import resource="cn/itcast/spring/sh/di/constructor/applicationContext-di-constructor.xml" /> --> <!-- <import resource="cn/itcast/spring/sh/document/applicationContext-document.xml" /> --> <!-- <import resource="cn/itcast/spring/sh/mvc/applicationContext-mvc.xml"/> -->
</beans>

spring配置,spring中的bean 的id不能相同的更多相关文章
- Spring配置文件结构对于生成Bean的影响
Spring配置文件结构对于生成Bean的影响 有段时间忙于毕设,导致Spring学习的东西忘了很多,所以最近又开始从头看Spring的基础.基础的Bean的装配不再多说了.这一次,主要是深入一点了解 ...
- Spring实战(四)Spring高级装配中的bean profile
profile的原意为轮廓.剖面等,软件开发中可以译为“配置”. 在3.1版本中,Spring引入了bean profile的功能.要使用profile,首先要将所有不同的bean定义整理到一个或多个 ...
- spring 在容器中一个bean依赖另一个bean 需要通过ref方式注入进去 通过构造器 或property
spring 在容器中一个bean依赖另一个bean 需要通过ref方式注入进去 通过构造器 或property
- Spring工具类 非spring管理环境中获取bean及环境配置
SpringUtils.java import org.springframework.beans.BeansException; import org.springframework.beans.f ...
- Spring IOC容器中注入bean
一.基于schema格式的注入 1.基本的注入方式 (属性注入方式) 根据setXxx()方法进行依赖注入,Spring只会检查是否有setter方法,是否有对应的属性不做要求 <bean id ...
- Spring在代码中获取bean的几种方式(转:http://www.dexcoder.com/selfly/article/326)
方法一:在初始化时保存ApplicationContext对象 方法二:通过Spring提供的utils类获取ApplicationContext对象 方法三:继承自抽象类ApplicationObj ...
- Spring配置事务中的 transactionAttributes 各属性含义及XML配置
转自:https://blog.csdn.net/z69183787/article/details/17161393 transactionAttributes 属性: PROPAGATION 事务 ...
- Spring在代码中获取bean的几种方式
方法一:在初始化时保存ApplicationContext对象 方法二:通过Spring提供的utils类获取ApplicationContext对象 方法三:继承自抽象类ApplicationObj ...
- Spring在代码中获取bean的几种方式(转)
获取spring中bean的方式总结: 方法一:在初始化时保存ApplicationContext对象 ApplicationContext ac = new FileSystemXmlApplica ...
随机推荐
- python实用技巧 : Filtering os.walk(转)
''' Created on Mar 7, 2010 @author: Diego 需求: 得到某个目录下, 符合过滤条件的文件夹/文件.实现: 将os.walk再次包装. TODO: 不知道本程序的 ...
- 计蒜客 1460.Ryuji doesn't want to study-树状数组 or 线段树 (ACM-ICPC 2018 徐州赛区网络预赛 H)
H.Ryuji doesn't want to study 27.34% 1000ms 262144K Ryuji is not a good student, and he doesn't wa ...
- POJ 1008 Maya Calendar / UVA 300【日期转换/常量数组】
Maya Calendar Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 82431 Accepted: 25319 Descr ...
- POJ 3553 Task schedule【拓扑排序 + 优先队列 / 贪心】
Task schedule Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 515 Accepted: 309 Special J ...
- 训练指南 UVA - 11354(最小生成树 + 倍增LCA)
layout: post title: 训练指南 UVA - 11354(最小生成树 + 倍增LCA) author: "luowentaoaa" catalog: true ma ...
- Fruit Feast(暴力)(动态规划)
Fruit Feast 时间限制: 1 Sec 内存限制: 64 MB提交: 64 解决: 18[提交][状态][讨论版] 题目描述 Bessie has broken into Farmer J ...
- [BZOJ4367][IOI2014]Holiday(决策单调性+分治+主席树)
4367: [IOI2014]holiday假期 Time Limit: 20 Sec Memory Limit: 64 MBSubmit: 421 Solved: 128[Submit][Sta ...
- CodeChef - UASEQ Chef and sequence
Read problems statements in Mandarin Chinese and Russian. You are given an array that consists of n ...
- Codeforces 915 E Physical Education Lessons
题目描述 This year Alex has finished school, and now he is a first-year student of Berland State Univers ...
- [xsy1294]sub
给出一棵$N$个节点的无根树,节点$i$有权值$v_i$.现在有$M$次操作,操作有如下两种: $1\ x\ y$ 将节点$x$的权值$v_x$修改为$y$ $2$ 选择一个联通块(也可以不选择),使 ...