users@jersey.java.net

Re: Resource Filter/Interception/Handler

From: Andrew Ochsner <aochsner_at_cs.stanford.edu>
Date: Tue, 28 Oct 2008 15:19:33 -0600

Looks like ContainerRequestFilter and ContainerResponseFilter might be what
I'm after. Any examples or snippets as to how to use these?

Thanks again
Andy O

On Tue, Oct 28, 2008 at 3:12 PM, Andrew Ochsner <aochsner_at_cs.stanford.edu>wrote:

> Hi:
>
> I need to grab some information out of the Http Headers before every call
> to a resource. I take it the best way to do this is to use a Servlet
> Filter?
>
> Is there any other way to do this in Jersey? What if I wanted to some
> JSR311 @Context information in this thing? Are there any hooks in Jersey to
> configure a handler to execute before (and maybe after) every call to a
> resource and have Jersey inject it's JSR311 specific annotated stuff?
>
> I guess I'm kinda thinking similar to SOAP handlers/interceptors, but I
> know its a bit different in a REST world.
>
> So, only option currently to use a Filter? Or am I missing something?
>
> Thanks
> Andy O
>