tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "TURPIN Michel (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TOMEE-2120) JaxRS Interceptors don't get request properties
Date Tue, 22 Aug 2017 13:28:01 GMT
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)

Mime
View raw message