bean7.xml 1.2 KB

1234567891011121314151617181920212223
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. 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">
  6. <bean id="user2" class="com.sf.entity.User2" init-method="init" destroy-method="destroy">
  7. <property name="userId" value="1001"></property>
  8. <property name="userName" value="admin"></property>
  9. </bean>
  10. <!-- 实例化后置处理器ABeanPostProcessor-->
  11. <bean id="aBeanPostProcessor" class="com.sf.processor.ABeanPostProcessor"></bean>
  12. <!-- 外部资源导入-->
  13. <context:property-placeholder location="classpath:db.properties"></context:property-placeholder>
  14. <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
  15. <property name="username" value="${jdbc_user}"></property>
  16. <property name="password" value="${jdbc_password}"></property>
  17. <property name="url" value="${jdbc_url}"></property>
  18. </bean>
  19. </beans>