I think there is another alternative, which is content negotiation:
Code: Select all
// an example to convert a JAXBSource into XML/JSON/text
@Produce({"application\xml", "application\json", "text\plain", "text\html"})
public JAXBSource getResult(){
....
}