javaee1/spring/target/classes/app.xml

22 lines
1.2 KiB
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"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
<!-- 开启注解-->
<context:component-scan base-package="com.spring"/>
<!-- UserDao userDao = new UserDao(); -> spring容器创建类的实例-->
<!--<bean id="userDao1" class="com.spring.UserDao">-->
<!--</bean>-->
<!--&lt;!&ndash;name="userDao" 实例化的对象成员变量的名字 ref="userDao" sping容器中实例化对象的名字&ndash;&gt;-->
<!--<bean id="userService" class="com.spring.UserService" autowire="byType">-->
<!--</bean>-->
<!--<bean id="dbTools" class="com.spring.DBTools">-->
<!-- <property name="ip" value="127.0.0.1"/>-->
<!-- <property name="port" value="3306"/>-->
<!-- <property name="username" value="root"/>-->
<!--</bean>-->
</beans>