I'm trying to bind a name to a filter in JAX-RS so I can secure some methods in the rest service as the following:
Secured Name Binding:
@NameBinding
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(value = RetentionPolicy.RUNTIME)
public @interface Secured {
}
Authentication Filter:
@Secured
@Provider
@Priority(Priorities.AUTHENTICATION)
public class AuthenticationAgent implements ContainerRequestFilter {
@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
//do something
}
}
However, eclipse is giving me this error when I'm adding the secured annotation to my filter.
There is no JAX-RS application, resource or resource method with this name binding annotation.