Description
If we create a NameBinding annotation:
@NameBinding @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD}) public @interface Filtered { }
and qualify a ContainerResponseFilter:
@Filtered @Provider public class TestNameBoundFilter implements ContainerResponseFilter { @Override public void filter( ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { MultivaluedMap<String, Object> headers = responseContext.getHeaders(); headers.putSingle("NameBoundFiltered", "true"); } }
and some methods in a Resource:
public class NameBoundResource { @GET @Filtered @Path("/filtered") public String filtered() { return "filtered"; } @GET @Path("/unfiltered") public String unfiltered() { return "unfiltered"; } }
only responses for requests made to "/filtered" path should carry the "NameBoundHeader" header. However both responses, to "/filtered" and "/unfiltered" carry the header.
Attachments
Issue Links
- links to