users@jersey.java.net

[Jersey] Re: Annotations in interfaces, how to use with jersey?

From: Guy Rouillier <guy.rouillier_at_gmail.com>
Date: Fri, 14 Mar 2014 13:22:59 -0400

Sorry, I don't have any experience with that. I used Eclipse to "Extract
interface", and it extracted the annotations. So, the annotations are
in both the interface and the class. We rely on the Jersey scanner to
find resources, and it does that via annotations. So I'm guessing if
your class doesn't have annotations on it, Jersey wouldn't think that
was a resource class. But that's just a guess.

On 3/14/2014 1:05 PM, Graham Leggett wrote:
> On 14 Mar 2014, at 6:42 PM, Guy Rouillier <guy.rouillier_at_gmail.com>
> wrote:
>
>> We encountered the same issue. The simplest solution is to move
>> your interfaces to a different package. That was a better solution
>> for us in the long run anyway; we exported the interface package to
>> a client JAR to be used with the client proxy.
>
> Am I right in understanding that if jersey finds a concrete class,
> and the class implements a given interface with the required
> annotations, jersey will just "do the right thing" and treat the
> annotations as if they had been applied directly to the concrete
> class, interface and concrete class just need to be in different
> packages?
>
> Regards, Graham --
>


-- 
Guy Rouillier
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com