On Dec 7, 2007, at 4:35 PM, Richard Wallace wrote:
> Thanks for the info. That's definitely what I'm looking for. Now
> the question is, how can I get the UriInfo object in a
> MessageBodyWriter?
> I've come up with about half a dozen ways that I can do it by using
> an interceptor and putting the UriInfo object in a thread local, or
> overriding ServletContainer and wrapping the WebApplicationImpl
> object to catch the handleRequest() method and stuff the
> ContainerRequest in a thread local. Or I could have my objects that
> I return from my resource methods be something like a Result object
> that wraps the actual response data and the UriInfo object.
>
> Of those, the last is probably the one that I would be most likely
> to pick, but it still seems a bit ugly to me. But if that's what I
> gotta do, I guess that's what I gotta do.
>
> Any other suggestions?
>
Hmm, I think for now the last of your suggestions is the way to go. I
think we may need to revisit MessageBodyWriter in JSR 311 so such
things can be accessed.
Marc.
---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.