I have the following annotation using javax.xml.bind.annotation.XmlElement
:
@XmlElement
public List getKeywords() {
r
Use this form:
@XmlElementWrapper(name="keywords")
@XmlElement(name="keyword")
Please note that if keywords
is empty then you will get
.
Sometimes you will need to add @XmlRootElement
to your class (depends on the context) and the @XmlAccessorType(XmlAccessType.?)
annotation. I usually use @XmlAccessorType(XmlAccessType.FIELD)
and annotate my fields with @XmlElement
.