[ 
https://issues.apache.org/jira/browse/CXF-7630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16349992#comment-16349992
 ] 

ASF GitHub Bot commented on CXF-7630:
-------------------------------------

csierra opened a new pull request #376: [CXF-7630] Do not preset namebindings 
when installing through a Feature
URL: https://github.com/apache/cxf/pull/376
 
 
   This makes `@NameBinding` work also when installing filters using a `Feature`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> NameBindings are ignored for (at least) ContextResponseFilters
> --------------------------------------------------------------
>
>                 Key: CXF-7630
>                 URL: https://issues.apache.org/jira/browse/CXF-7630
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.2.2
>            Reporter: Carlos Sierra
>            Priority: Major
>
> If we create a _NameBinding_ annotation:
> {code:java}
> @NameBinding
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD})
> public @interface Filtered {
> }{code}
> and qualify a _ContainerResponseFilter_:
> {code:java}
> @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");
>     }
> }{code}
> and some methods in a _Resource_:
> {code:java}
> public class NameBoundResource {
>     @GET
>     @Filtered
>     @Path("/filtered")
>     public String filtered() {
>         return "filtered";
>     }
>     @GET
>     @Path("/unfiltered")
>     public String unfiltered() {
>         return "unfiltered";
>     }
> }{code}
> only responses for requests made to _"/filtered"_ path should carry the 
> _"NameBoundHeader"_ header. However both responses, to _"/filtered"_ and 
> _"/unfiltered"_ carry the header.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to