Spring in action (1)时间:2023-03-09 18:37:16 spring中注入bean的方法: 1.通过xml文件来注入bean。 2.通过java注解来注入 默认的bean生命周期是单例的。每次都会返回相同的类的实例。