[jbosstools-issues] [JBoss JIRA] (JBIDE-18090) Wrong JAX-RS Filter/Annotation binding problem report
Xavier Coulon (JIRA)
issues at jboss.org
Mon Aug 18 06:19:31 EDT 2014
Xavier Coulon created JBIDE-18090:
-------------------------------------
Summary: 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
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
More information about the jbosstools-issues
mailing list