zoukankan      html  css  js  c++  java
  • spring启动

    System.out.println("加载配置文件,获取Spring容器:开始");
            //加载配置文件,,获取spring容器
    AbstractApplicationContext ac =new ClassPathXmlApplicationContext("applicationContext.xml");
            System.out.println("加载配置文件,获取Spring容器:结束");
            //通过Spring获取对象
            System.out.println("通过Spring容器获取对象:开始");
            Person ps = ac.getBean("person",Person.class);
            //Person ps1 = ac.getBean("person",Person.class);
            System.out.println("通过Spring容器获取对象:结束");
            //输出
            System.out.println("bean:"+ps);
            //System.out.println("bean:"+ps1);
            //释放资源
            System.out.println("释放资源:开始");
            ac.close();
            System.out.println("释放资源:结束");
    今日事今日毕
  • 相关阅读:
    Serialize&Deserialize
    Async&Await
    Generic
    Enum
    Array
    String
    Nullable
    Collection
    Class&Struct
    Interface
  • 原文地址:https://www.cnblogs.com/gjack/p/8659811.html
Copyright © 2011-2022 走看看