users@jersey.java.net

[Jersey] How to return List<String> by GET?

From: Pengfei Di <pengfei.di_at_match2blue.com>
Date: Mon, 14 Mar 2011 10:58:46 +0100

Hello group,

I am trying to return a list of jaxb beans by a get request. However, I
get some error message: A message body writer for Java class
java.util.LinkedList is needed.
I know that it is possible to use GenericEntity<List<String>> and return
Reponse, or build a class to wrap the list. But I rather prefer the
return type of List<String>.

Is it possible to return List<String> at all? If yes, how can I write
the message body writer for it?

Thanks a lot in advance for any hints!

Pengfei