注入内部bean:将实体类内部的对象也给赋值,废话不多说
文件结构如下:
内部类属性赋值:
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="stu" class="Module.Student">
<property name="name" value="mewec"></property>
<!--设置对象类型属性,可以使用类似外部bean的设置方法,先在外面创建内部对象的配置信息-->
<!--也可以通过以下方式设置出来-->
<property name=