users@jsr311.java.net

JSR311: WebAppExc subclasses? and: generic type for MessageBodyWriters

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Thu, 05 Jun 2008 22:07:17 +0200

Hi,

I've some questions:

*WebApplicationException*
Is a runtime envirnoment allowed to throw subclasses of WebAppExceptions
in the matching algorithms given by the spec, if the spec requires a
WebApplicationException? This subclasses could contain additional
attributes for data that is useful for a message generation. I've also
seen subclasses of WebAppExc in the Jersey API or SPI. But the runtime
environment must not provide special excpetion mappers for them, because
an exception mapper given by the user for WebApplicationException would
not be reached.

*genericType for the MessageBodyWriter*
The last days we discuss a way to provide the generic type to the
MessageBodyWriter. I don't understand why I can't reflect the method. I
could do it the same way I've do it, if a JAXBElement<Person> is
returned (or whatever generic there is). Or where whould I get it from
in this case? Dhanji argued right, that this has risks, e.g. that you
could only return one generic type here, but there is no more
information available. Where should I get this information from, if not
by reflections?

best regards
   Stephan