我被困在使用Spring 2.0.8(此时仍在等待签名升级),因为我不能使用注释我虽然我会使用xdoclet来生成bean我将在未来编写大量bean的配置文件。Xdoclet @ spring.bean没有正确生成配置文件
但是,当我运行我的ant目标时,它会创建xml文件,但它不包含任何bean标记。
我的Ant脚本是这样的:
<taskdef name="springdoclet" classname="xdoclet.modules.spring.SpringDocletTask">
<classpath refid="springdoclet.classpath"/>
</taskdef>
<taskdef name="doclet" classname="xdoclet.DocletTask">
<classpath refid="springdoclet.classpath"/>
</taskdef>
<target name="generate-spring-wiring">
<springdoclet destdir="${resource.dir}" excludedtags="@version,@author,@todo">
<fileset dir="${global.src.dir}"/>
<springxml destinationfile="spring-wiring.xml"/>
</springdoclet>
</target>
生成的XML文件是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC
"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans
default-autowire="no"
default-lazy-init="false"
default-dependency-check="none"
>
<!--
To include additional bean definitions for Spring in the generated
application context file, add a file to your XDoclet merge directory
called spring-beans.xml that contains the <bean></bean> markup.
-->
</beans>
正如你可以看到没有豆已经成立。
我的bean类全部从同一个源目录中的父类继承。该MasterBean已设置如下:
/**
*
*@spring.bean id="master"
*/
abstract public class Master implements Rule {
..
..
}
和样品子类(在同一个包被设置如下:
/**
*
* @spring.bean id="G27"
*/
public class Global27_IncorrectFormTypeForCA extends Master {
这事做的事实,我的班级扩展超?或者,我只是将它设置了不正确。这个文档是几乎不存在,因此任何帮助将感激收到。
感谢