dev@jersey.java.net

Re: [Jersey] Require SSL on a per-method basis?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 14 Apr 2010 17:55:24 +0200

On Apr 14, 2010, at 2:43 PM, James Russo wrote:

> Paul,
>
> Any suggestions on annotation names?

What about @Secure ? shorter :-)

Perhaps one could use @PermitNotSecure to override on a method @Secure
on the class?


> I've basically mirrored my implementation against the RolesRequired
> with a ResourceFilterFactory and an annotation called
> "SecureTransportRequired" and
> SecureTransportRequiredResourceFilterFactory..
>
> Is there an existing example I can look at when implementing at the
> class level? I don't think the am.isAnnotationPresent() looks at
> the class level annotation does it?
>

No. Do:

   am.getResource().isAnnotationPresent(...)

See the source for RolesAllowedResourceFilterFactory#143

Paul.