users@jersey.java.net

[Jersey] generified collections in return type

From: Shalom Ben-Zvii Kazaz <shalom938_at_gmail.com>
Date: Tue, 15 Mar 2011 22:25:33 +0200

Hi all
I have a resource method that needs to return:
public List<JAXBElement<Message>> myMethod()
I can't annotate Message because its a generated class.

but jersey doesn't support it by default:
A message body writer for Java class java.util.ArrayList, and Java type
java.util.List<javax.xml.bind.JAXBElement<com.my.Message>>, and MIME media
type application/json was not found


what is the way to marshall this return type?