如何为spring配置文件自动建议/自动完成?

时间:2014-04-11 11:09:17

标签: java xml spring configuration

<?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如上所示。我需要自动建议创建这个弹簧配置。有人可以帮忙吗?

1 个答案:

答案 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