Hi experts,
We met a not very big issue on developing our solutions, but I guess a confirmation will do great help.
That is, we have multiple XSD to construct our objects and they import and referred each other. Our problem is sometimes we will meet some generated POJO without @XmlRootElement with that (after investigation these POJO are not the out most Element) but we really want to return that in JAX-RS resource methods.
Currently we are doing workaround by ObjectFactory and it seems working fine, but it just looks like a workaround;
@GET
public Object a() {
final JAXBElement<MyPOJO> jaxb = new ObjectFactory().createMyPOJO(myPOJO);
return jaxb;
}
I am wondering is there any more graceful way to handle this case. I browsed the internet and it seems some JAX-RS container have some switches to do this for application developers – do you think we have similar solution in Jersey, or at least do you think this is a good feature for future?
Thanks
Grant.