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
https://www.springframework.org/schema/beans/spring-beans.xsd">
<!--bean可以定义多个名称,使用name属性完成-->
<!--<bean id="userService" name="userService1,userService2" class="com.itheima.service.impl.UserServiceImpl"/>-->
<!--scope用于控制bean创建后的对象是否为单列-->
<bean id="userService3" scope="prototype" class="com.itheima.service.impl.UserServiceImpl"/>
</beans>