我使用REST,我想知道如果我可以告诉jaxb插入一个字符串字段“原样”到传出的XML。 当然,我计算之前解压缩它,但我想保存这一步。JAXB使用字符串,因为它是
@XmlRootElement(name="unnestedResponse")
public class Response{
@Insert annotation here ;-)
private String alreadyXml;
private int otherDate; ...
}
是否存在告诉JAXB仅仅使用字符串而不逃脱的可能性?我希望客户端不必解析我的响应,然后解析这个字段。
问候, 米
[使用JAXB提取XML元素的内部文本]的可能重复(http://stackoverflow.com/questions/5537416/using-jaxb-to-extract-inner-text-of-xml-element) –