0
我使用此域名類別:Grails的JAXB元素列表爲空
@XmlRootElement(name="Target")
@XmlAccessorType(XmlAccessType.NONE)
class TargetElement {
static constraints = {
testPurpose()
}
@XmlAttribute(name="TestPurpose")
String testPurpose
// instead of bellow in comment use this
@XmlElementWrapper(name = "Bag")
@XmlElement(name="Child")
List<Child> bag= new ArrayList<Child>()
// 1..n Child
static hasMany = [child:Child]
}
如果我想補充兒童ELEM,我用
,但我得到了list == null
袋。
爲什麼我的列表爲空?它正在爲另一個項目工作,只有名稱正在改變。可能是我的眼睛失去了一些東西......