<?xml version="1.0" encoding="UTF-8"?>
<bean id="reservation" class="com.youtube.Reservation" init-method="init" destroy-method="destroy">
<property name="train" ref="trainobject" />
<property name="bus" ref="busobject" />
</bean>
<bean id="busobject" class="com.youtube.Mode">
<property name="name" value="KPN" />
</bean>
<bean id="trainobject" class="com.youtube.Mode">
<property name="name" value="Shatabdi" />
</bean>
我的XML如上所示。我需要自动建议创建这个弹簧配置。有人可以帮忙吗?
答案 0 :(得分:0)
首先,正确的beans
标记很有用。
<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 http://www.springframework.org/schema/context/spring-context.xsd">
有关此主题,请参阅Spring documentation。