users@jersey.java.net

[Jersey] Re: Container filter and Annotation

From: Martin Matula <martin.matula_at_oracle.com>
Date: Tue, 22 Nov 2011 17:30:41 +0100

Is it important for you to handle the request that does not match any
URI in the *request* filter? Can't you handle it in the response filter
instead? That would allow you to have resource filter for the matching
cases and response filter for the non-matching cases.
Martin

On 22.11.2011 1:41, go_at_livemocha.com wrote:
> Hello,
>
> I have a resource filter that looks at annotations supported by a
> resource to do a few things. So, this, I believe, is a perfect use
> case for Resource Filter.
>
> Now, I have to make it so that logic in this filter be executed even if
> there is no resource matching for a request. To do this, I think I
> need to change my filter to Container Filter. But if I do that, I lose
> Annotation based configuration.
>
> My question is, Is there a way to get a list Annotations supported by a
> resource in Container Filter? If there is no resource available for a
> request, some kind of signal (null, an empty list) is sufficient for me
> to do the right thing.
>
> If this is not possible, is is possible to get URI to
> AbstractResourceMethod mapping in a Sprint servlet filter? If there
> is, I can move the logic to a servlet...
>
> Thanks,
> Go