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不能相同的更多相关文章

  1. Spring配置文件结构对于生成Bean的影响

    Spring配置文件结构对于生成Bean的影响 有段时间忙于毕设,导致Spring学习的东西忘了很多,所以最近又开始从头看Spring的基础.基础的Bean的装配不再多说了.这一次,主要是深入一点了解 ...

  2. Spring实战(四)Spring高级装配中的bean profile

    profile的原意为轮廓.剖面等,软件开发中可以译为“配置”. 在3.1版本中,Spring引入了bean profile的功能.要使用profile,首先要将所有不同的bean定义整理到一个或多个 ...

  3. spring 在容器中一个bean依赖另一个bean 需要通过ref方式注入进去 通过构造器 或property

    spring  在容器中一个bean依赖另一个bean 需要通过ref方式注入进去 通过构造器 或property

  4. Spring工具类 非spring管理环境中获取bean及环境配置

    SpringUtils.java import org.springframework.beans.BeansException; import org.springframework.beans.f ...

  5. Spring IOC容器中注入bean

    一.基于schema格式的注入 1.基本的注入方式 (属性注入方式) 根据setXxx()方法进行依赖注入,Spring只会检查是否有setter方法,是否有对应的属性不做要求 <bean id ...

  6. Spring在代码中获取bean的几种方式(转:http://www.dexcoder.com/selfly/article/326)

    方法一:在初始化时保存ApplicationContext对象 方法二:通过Spring提供的utils类获取ApplicationContext对象 方法三:继承自抽象类ApplicationObj ...

  7. Spring配置事务中的 transactionAttributes 各属性含义及XML配置

    转自:https://blog.csdn.net/z69183787/article/details/17161393 transactionAttributes 属性: PROPAGATION 事务 ...

  8. Spring在代码中获取bean的几种方式

    方法一:在初始化时保存ApplicationContext对象 方法二:通过Spring提供的utils类获取ApplicationContext对象 方法三:继承自抽象类ApplicationObj ...

  9. Spring在代码中获取bean的几种方式(转)

    获取spring中bean的方式总结: 方法一:在初始化时保存ApplicationContext对象 ApplicationContext ac = new FileSystemXmlApplica ...

随机推荐

  1. PHP serialize 和 JSON 解析与区别

    PHP serialize 和 JSON 解析与区别 对于JSON(JavaScript Object Notation)大家应该不陌生,它是一种轻量级的数据交换格式.易于人阅读和编写.同时也易于机器 ...

  2. Codeforces 1023 A.Single Wildcard Pattern Matching-匹配字符 (Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Fi)

    Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) A. Single Wildcard Patter ...

  3. HDU 5935 Car【贪心,枚举,精度】

    Problem Description Ruins is driving a car to participating in a programming contest. As on a very t ...

  4. 如何破解Webstorm 2016.2

    嗯,随着Webstorm2016.2的推出,网上的很多破解方法已经不能用了,不过功夫不负有心人,我终于查到了新的方法, 选择“license server” 输入:http://114.215.133 ...

  5. Python3 list记录

    #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author;Tsukasa name = ['YangJiaHui','LiuYueEr','TaB ...

  6. Linux命令之halt、poweroff、reboot

    halt [选项] poweroff [选项] reboot [选项] 这三个命令模式一样,目的是引导内核启动或停止系统的运行:当没有-f参数或系统运行级别不是0和6,将执行/sbin/shutdow ...

  7. java中的3大特性之继承

    继承的特点:继承父类的属性和方法.单继承(多层继承)c++里的继承是多继承 特性 :方法的复写(重写) java中的继承和OC中一样. 比如:人可以养狗; 人---->狗 :整体和部分(拥有)关 ...

  8. 解密所有APP运行过程中的内部逻辑(转)

    转贴地址:http://www.freebuf.com/tools/54562.html 0×01前言 这年头,apk 全都是加密啊,加壳啊,反调试啊,小伙伴们表示已经不能愉快的玩耍了.静态分析越来越 ...

  9. PHP超全局变量$_ENV详解,及$_ENV为空的可能原因

    PHP中的$_ENV存储了一些系统的环境变量,因为牵扯到实际的操作系统,所以不可能给出$_ENV的完整列表. $_ENV为空的可能原因:  你的php.ini的variables_order值为&qu ...

  10. 【k8s】了解一下k8s

    了解一下k8s 地址: https://www.kubernetes.org.cn/doc-11