You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "TURPIN Michel (JIRA)" <ji...@apache.org> on 2017/08/22 13:28:01 UTC

[jira] [Created] (TOMEE-2120) JaxRS Interceptors don't get request properties

TURPIN Michel created TOMEE-2120:
------------------------------------

             Summary: JaxRS Interceptors don't get request properties
                 Key: TOMEE-2120
                 URL: https://issues.apache.org/jira/browse/TOMEE-2120
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 7.0.3
            Reporter: TURPIN Michel


Given the filter/interceptor below, the console should output {{baz}} for every call to a resource that provides an entity.
It actually output {{null}}.

{code:java|title=InterceptorBug.java}
@Provider
public class InterceptorBug implements ContainerRequestFilter, WriterInterceptor {

    @Override
    public void filter(ContainerRequestContext requestContext) throws IOException {
        requestContext.setProperty("foo.bar", "baz");
    }

    @Override
    public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {
        context.proceed();
        System.out.println(context.getProperty("foo.bar"));
    }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)