Hi

Perhaps you can do
MessageBodyWriter<List>

and then in writeTo you can check the class of, say, the first List element and 
then
do either ABC or Integer marshalling ?

Cheers, Sergey


I have a problem regarding to MessageBodyWriter

I have two custom "provider"s

public class WriterListABC implements MessageBodyWriter<List<ABC>>
public class WriterListInteger implements MessageBodyWriter<List<Integer>>

ABC is my custom class

When I return a List<Integer> , it seems it will find WriterListABC ,
not WriterListInteger
and it throws "cannot cast Integer to ABC ..." exception.
It seems it is because java's generics is runtime type-erasure....
But how to solve this problem ?

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to