My filters work for both assuming you make sure the context is the same. I
have a hazelcast session filter that is used for both http and your jersey
library.
@Path("/api")
@Component(service = {ApiService.class},
property = {
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT +
"=(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME
+ "=Aardvark.Context)"
})
You can also add rest particular filters. I do this for my CORS filter
@Provider
@Component(service = {CORSResponseFilter.class},
property = {
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT +
"=(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME +
"=org.osgi.service.http)"
})
public class CORSResponseFilter implements ContainerResponseFilter {
On Fri, Jul 8, 2016 at 2:52 PM, Benson Margulies <[email protected]>
wrote:
> Indeed, I very much doubt it. I'm afraid I have CXF on the brain.
>
> On Fri, Jul 8, 2016 at 2:34 PM, Marc Durand <[email protected]> wrote:
> > I am not sure how a CXF annotation can work in my case - I am not using
> CXF
> > at all. I am using Jersey and OSGI-JAX-RS-Connector.
> >
> > On Fri, Jul 8, 2016 at 2:12 PM, Benson Margulies <[email protected]>
> > wrote:
> >
> >> org.apache.cxf.annotations.GZIP
> >>
> >> On Fri, Jul 8, 2016 at 2:05 PM, Marc Durand <[email protected]>
> wrote:
> >> > Thanks Benson for the quick response. What is the package name of
> that
> >> > annotation?
> >> >
> >> > Marc
> >> >
> >> > On Fri, Jul 8, 2016 at 1:46 PM, Benson Margulies <
> [email protected]>
> >> > wrote:
> >> >
> >> >> @GZIP on the resource class works for me.
> >> >>
> >> >>
> >> >> On Fri, Jul 8, 2016 at 1:44 PM, Marc Durand <[email protected]>
> >> wrote:
> >> >> > I have successfully added a gzip filter to the default web
> container
> >> in
> >> >> Karaf
> >> >> > and responses coming from regular servlets are compressed. This
> >> filter
> >> >> does
> >> >> > not seem to apply to REST responses that are produced through the
> >> >> > osgi-jax-rs-connector bundle. How can I enable compression of REST
> >> >> > responses in Karaf?
> >> >> >
> >> >> > Thanks in advance!
> >> >> > Marc
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >>
> >>
> http://karaf.922171.n3.nabble.com/Enabling-compression-of-HTTP-responses-when-using-osgi-jax-rs-connector-tp4047174.html
> >> >> > Sent from the Karaf - Dev mailing list archive at Nabble.com.
> >> >>
> >>
>