]
Radoslav Rábara closed JBIDE-18090.
-----------------------------------
Verified with JBDS 8.0.0.CR1-v20140831-0335-B201
Wrong JAX-RS Filter/Annotation binding problem report
------------------------------------------------------
Key: JBIDE-18090
URL:
https://issues.jboss.org/browse/JBIDE-18090
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: webservices
Affects Versions: 4.2.0.Beta3
Reporter: Xavier Coulon
Assignee: Xavier Coulon
Fix For: 4.2.0.CR1
The JAX-RS validator reports a false problem on Interceptors and Filters with binding
annotations, when multiple binding anntotations on the target Resource or Resource Methods
are involved.
Eg:
{code}
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(value = RetentionPolicy.RUNTIME)
@NameBinding
public @interface RequestIfNoneMatchBinding { }
{code}
and
{code}
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(value = RetentionPolicy.RUNTIME)
@NameBinding
public @interface CacheInvalidationBinding {}
{code}
with
{code}
@Provider
@PreMatching
@RequestIfNoneMatchBinding
public class RequestIfNoneMatchFilter implements ContainerRequestFilter {
@Override
public void filter(final ContainerRequestContext requestContext) throws IOException {
...
}
}
{code}
on
{code}
@RequestScoped
@Path("/foo")
public class RestResource {
@GET
@RequestIfNoneMatchBinding
@CacheControlBinding
public Response getAll() {
return Response.ok().build();
}
}
{code}
The {{RequestIfNoneMatchFilter}} class will have a JAX-RS problem reported while it
should not be the case.
The spec mentions that the resource/resource method should be annotated with all the same
binding annotations as the Filter/Interceptor, which is the case here. Nothing prevents a
resource / resource method to be bound to multiple Filter or Interceptor