a BigDecimal field in Action Form can't be generated for struts's validation.xml
赵景彦 <[email protected]>
| Newsgroups | gmane.comp.java.xdoclet.user |
|---|---|
| Message-ID | <[email protected]> |
Hello all,
I'm using Xdoclet to generate action form validation files, and I found the following problem, In action form , BigDecimal field can't be generated in validation.xml , Have you encountered the similar problem?
my actionform is the below:
package web.form;
import java.io.Serializable;
import java.math.BigDecimal;
import org.apache.struts.validator.ValidatorForm;
/**
* @struts.form
* name ="testForm"
* include-all="true"
* @author fisher
*
*/
public class TestForm extends ValidatorForm implements Serializable{
private Long id;
private String name;
private BigDecimal capital;
public Long getId() {
return id;
}
public String getName() {
return name;
}
public BigDecimal getCapital() {
return capital;
}
/**
* @struts.validator
* type = "required"
* @struts.validator-args
* arg0resource="testForm.id"
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* @struts.validator
* type = "required"
* @struts.validator-args
* arg0resource="testForm.name"
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @struts.validator
* type = "required"
* @struts.validator-args
* arg0resource="testForm.capital"
* @param capital
*/
public void setCapital(BigDecimal capital) {
this.capital = capital;
}
}
ant webdoclet task define as:
<target name="webdoclet" depends="init">
<webdoclet
mergedir="${struts-merge}"
destdir="${struts}"
excludedtags="@version,@author"
force="${xdoclet.force}">
<fileset dir="${src}">
<include name="**/*Form.java"/>
<include name="**/*Action.java"/>
</fileset>
<strutsconfigxml
version="1.2" validateXML="true"/>
<strutsvalidationxml
version="1.1.3" validateXML="true" />
</webdoclet>
</target>
run webdoclet task, i found the testForm in validation.xml as following:
<form name="testForm">
<field property="id"
depends="required">
<arg0
key="testForm.id"
/>
</field>
<field property="name"
depends="required">
<arg0
key="testForm.name"
/>
</field>
</form>
TestForm's property capital isn't in validation.xml, that's why,?
thanks for your time.
--------------------------------
fisher