Hi If you have explicit
List<Integer> and List<ABC> returned in your methods then you'd be able to get to the generic type in MessageBodyWriter.writeTo(), it has Type argument there. JAX-RS 0.9 also introduces GenericTypeEntity - it would let you to preserve type info at runtime but would require to use this JAX-RS specific class in the signature. Cheers, Sergey -----Original Message----- From: smallufo [mailto:[EMAIL PROTECTED] Sent: 02 October 2008 18:53 To: [email protected] Subject: Re: Generics runtime type erasure problem ? Oops It seems it is the only solution..... Sigh.... First time feeling runtime type erasure ...needs to be improved........ 2008/10/1 Sergey Beryozkin <[EMAIL PROTECTED]>: > 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 ? > ---------------------------- IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
