I have this DTO to be converted to XML/JSON and send response to client from my web service. We are using Jersey.
@XmlRootElement(name = "response")
public class Response {
@XmlValue
private String value="true";
}
It is getting properly converted to XML,
<response>true</response>
but json is missing out the parent tag,
it is outputting true instead of response:true
Is anybody having the same problem?
It is actually because we are omitting parent tag while outputing JSON.
Just in this case omitting parent tag is causing problem as there is only one value in the object.