I have a use case where the user is requesting jsonp encoding e.g. via custom 
media type or a .jsonw ending.

Anyway. I can intercept the call and surround with "jsonp();" successfully, but 
the returned
content-type needs to be changed to "application/javascript".

I could accept that as incoming type, but then RE is complaining about no 
matching MessageBodyWriter.

So I am thinking of using ContainerWriteFilter to re-write this, but the calls 
seem to be

MessageHandler method (@GET foo() {} )  (1)
ContainerWriteFilter   (2)
<message body writer> (3)
WriterInterceptor. (4)

So when I rewrite the content header in (2) a the mbw in (3) complains about 
wrong type and
in (4) I can not check if the desired content type is my custom one to request 
the wrapping or not.

So I would need to run a ContainerWriteFilter at (5) to rewrite the header 
*after* the interceptor has run.

In RHQ I solved that with a normal servlet filter, but it looks like this does 
not work here because
of Async processing (and rewriting the filter with an AsyncListener has its own 
issues )


Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
Resteasy-users mailing list

Reply via email to