一、在同一个xml配置文件里配置两个相同ID的bean 如果在同一个 xml 配置文件里配置两个相同 ID 的 bean,在 Spring 容器启动时会报错 在 resources 目录下增加 beans.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.xsd"> <bean id="demoService" class="com.victor.demo.service.DemoService01"/> <bean id="demoService"...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with List
Contact List, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack